equal
deleted
inserted
replaced
198 |
198 |
199 ROLES_ANNOTATIONS_KEY = 'pyams_security.roles' |
199 ROLES_ANNOTATIONS_KEY = 'pyams_security.roles' |
200 |
200 |
201 |
201 |
202 @adapter_config(context=IDefaultProtectionPolicy, provides=IRoleProtectedObject) |
202 @adapter_config(context=IDefaultProtectionPolicy, provides=IRoleProtectedObject) |
203 def ProtectedObjectFactory(context): |
203 def protected_object_factory(context): |
204 """Default protected object factory""" |
204 """Default protected object factory""" |
205 annotations = IAnnotations(context) |
205 annotations = IAnnotations(context) |
206 protection = annotations.get(ROLES_ANNOTATIONS_KEY) |
206 protection = annotations.get(ROLES_ANNOTATIONS_KEY) |
207 if protection is None: |
207 if protection is None: |
208 protection = annotations[ROLES_ANNOTATIONS_KEY] = RoleProtectedObject() |
208 protection = annotations[ROLES_ANNOTATIONS_KEY] = RoleProtectedObject() |