Fix a typo in the security agent ( my last commit ) that broke a bunch of stuff.

This commit is contained in:
Greg Von Kuster
2008-08-18 09:00:53 -04:00
parent 199e3327df
commit 140d8b5f7d
+4 -1
View File
@@ -21,7 +21,7 @@ class RBACAgent:
DATASET_MANAGE_PERMISSIONS = 'dataset_manage_permissions',
# The ability to perform any read only operation on the dataset (view, display at external site,
# use in a job, etc).
DATASET_ACCESSS = 'dataset_access'
DATASET_ACCESS = 'dataset_access'
)
def allow_action( self, user, action, **kwd ):
raise 'No valid method of checking action (%s) on %s for user %s.' % ( action, kwd, user )
@@ -68,6 +68,7 @@ class GalaxyRBACAgent( RBACAgent ):
raise 'No valid method of checking action (%s) on %s for user %s.' % ( action, kwd, user )
def allow_dataset_action( self, user, action, dataset ):
"""Returns true when user has permission to perform an action"""
log.debug("In allow_dataset_action, user: %s, action: %s, dataset: %s" % ( str(user), str(action), str(dataset)))
if not isinstance( dataset, self.model.Dataset ):
dataset = dataset.dataset
# If dataset is in public group, we always return true for viewing and using
@@ -238,9 +239,11 @@ class GalaxyRBACAgent( RBACAgent ):
def get_permitted_actions( self, filter=None ):
'''Utility method to return a subset of RBACAgent's permitted actions'''
if filter is None:
log.debug("In get_permitted_actions, returning RBACAgent.permitted_actions: %s" % str( RBACAgent.permitted_actions))
return RBACAgent.permitted_actions
if not filter.endswith('_'):
filter += '_'
tmp_bunch = Bunch()
[tmp_bunch.__dict__.__setitem__(k, v) for k, v in RBACAgent.permitted_actions.items() if k.startswith(filter)]
log.debug("In get_permitted_actions, returning tmp_bunch: %s" % str( tmp_bunch))
return tmp_bunch