X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=bluechips%2Flib%2Fpermissions.py;h=a22eb0b0e130c4a372755a02de94bd3ee85849e2;hb=ad599e867f780bca7ca1e96e463be00bc4884354;hp=393cc6c3048ef528f0390c651de5f0ea5d28d8b4;hpb=87c21aedbae2673b438b462b7729caf182e91de2;p=bluechips.git diff --git a/bluechips/lib/permissions.py b/bluechips/lib/permissions.py index 393cc6c..a22eb0b 100644 --- a/bluechips/lib/permissions.py +++ b/bluechips/lib/permissions.py @@ -3,7 +3,7 @@ authkit authorization permission objects for BlueChips """ from authkit.authenticate import AddDictToEnviron -from authkit.authorize import NotAuthorizedError +from authkit.authorize import NotAuthenticatedError, NotAuthorizedError from authkit.permissions import RequestPermission from sqlalchemy.exceptions import InvalidRequestError @@ -28,8 +28,11 @@ class DummyAuthenticate(AddDictToEnviron): Set the authkit.authenticate environment variable so authkit.authorize shuts up """ - def __init__(self, app): - super(DummyAuthenticate, self).__init__(app, { - 'authkit.authenticate': True}) + def __init__(self, app, app_conf): + newenv = {} + newenv['authkit.authenticate'] = True + if 'fake_username' in app_conf: + newenv['REMOTE_USER'] = app_conf['fake_username'] + super(DummyAuthenticate, self).__init__(app, newenv) __all__ = ['BlueChipUser', 'DummyAuthenticate']