[Subversion] / PEAK / src / peak / security / interfaces.py  

Diff of /PEAK/src/peak/security/interfaces.py

Parent Directory | Revision Log

version 1941, Tue Nov 23 20:37:48 2004 UTC version 1942, Tue Nov 23 23:26:05 2004 UTC
Line 6 
Line 6 
 __all__ = [  __all__ = [
     'IAuthorizedPrincipal', 'IInteraction', 'IAccessAttempt',      'IAuthorizedPrincipal', 'IInteraction', 'IAccessAttempt',
     'IAbstractPermission', 'IAbstractPermission', 'IPermissionChecker',      'IAbstractPermission', 'IAbstractPermission', 'IPermissionChecker',
     'IGuardedObject', 'IGuardedClass', 'IGuardedDescriptor',      'IGuardedObject', 'IGuardedClass',
 ]  ]
   
 class IAccessAttempt(Interface):  class IAccessAttempt(Interface):
Line 265 
Line 265 
         """Return (abstract) permission needed to access 'name', or 'None'"""          """Return (abstract) permission needed to access 'name', or 'None'"""
   
   
 class IGuardedDescriptor(Interface):  
   
     """Descriptor that knows the permission required to access it"""  
   
     permissionNeeded = Attribute(  
         "Sequence of abstract permissions needed, or 'None' to keep default"  
     )  
   
   
   
   
   
   
   
   
   
Line 285 
Line 272 
   
   
   
 whenImported(  
     'peak.binding.once',  
     lambda once:  
         protocols.declareAdapter(  
             protocols.NO_ADAPTER_NEEDED,  
             provides = [IGuardedDescriptor],  
             forTypes = [once.Descriptor, once.Attribute]  
         )  
 )  
   
 whenImported(  
     'peak.model.features',  
     lambda features:  
         protocols.declareAdapter(  
             protocols.NO_ADAPTER_NEEDED,  
             provides = [IGuardedDescriptor],  
             forTypes = [features.FeatureClass]  
         )  
 )  
   
 protocols.declareAdapter(  
     # Functions can be guarded descriptors if they define 'permissionsNeeded'  
     lambda o: (getattr(o,'permissionNeeded',None) is not None) and o or None,  
     provides = [IGuardedDescriptor],  
     forTypes = [FunctionType]  
 )  
   
   
   
   
   


Generate output suitable for use with a patch program
Legend:
Removed from v.1941  
changed lines
  Added in v.1942

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help