schema.py
changeset 4005 dee7af82beff
parent 4004 c52619c738a5
child 4019 7f68077d2c3b
equal deleted inserted replaced
4004:c52619c738a5 4005:dee7af82beff
   423         return False
   423         return False
   424 
   424 
   425     def has_perm(self, session, action, **kwargs):
   425     def has_perm(self, session, action, **kwargs):
   426         """return true if the action is granted globaly or localy"""
   426         """return true if the action is granted globaly or localy"""
   427         if 'fromeid' in kwargs:
   427         if 'fromeid' in kwargs:
   428             subjtype = session.describe(kwargs['fromeid'])
   428             subjtype = session.describe(kwargs['fromeid'])[0]
   429         else:
   429         else:
   430             subjtype = None
   430             subjtype = None
   431         if 'toeid' in kwargs:
   431         if 'toeid' in kwargs:
   432             objtype = session.describe(kwargs['toeid'])
   432             objtype = session.describe(kwargs['toeid'])[0]
   433         else:
   433         else:
   434             objtype = Nono
   434             objtype = Nono
   435         if objtype and subjtype:
   435         if objtype and subjtype:
   436             return self.rdef(subjtype, objtype).has_perm(session, action, **kwargs)
   436             return self.rdef(subjtype, objtype).has_perm(session, action, **kwargs)
   437         elif subjtype:
   437         elif subjtype: