Changeset 6160
- Timestamp:
- Nov 15, 2007, 7:05:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/trac/attachment.py
r6159 r6160 80 80 OK.""" 81 81 82 class ILegacyAttachmentPolicyDelegate(Interface): 83 """Interface that can be used by plugins to seemlessly participate to the 84 legacy way of checking for attachment permissions. 85 86 This should no longer be necessary once it becomes easier to 87 setup fine-grained permissions in the default permission store. 88 """ 89 90 def check_attachment_permission(action, username, resource, perm): 91 """Return the usual True/False/None security policy decision 92 appropriate for the requested action on an attachment. 93 94 :param action: one of ATTACHMENT_VIEW, ATTACHMENT_CREATE, 95 ATTACHMENT_DELETE 96 :param username: the user string 97 :param resource: the `Resource` for the attachment. Note that when 98 ATTACHMENT_CREATE is checked, the resource `.id` 99 will be `None`. 100 :param perm: the permission cache for that username and resource 101 """ 82 102 83 103 … … 696 716 697 717 implements(IPermissionPolicy) 718 719 delegates = ExtensionPoint(ILegacyAttachmentPolicyDelegate) 698 720 699 721 # IPermissionPolicy methods … … 720 742 (username, resource, legacy_action)) 721 743 return decision 744 else: 745 for d in self.delegates: 746 decision = d.check_attachment_permission(action, username, 747 resource, perm) 748 if decision is not None: 749 return decision
Note:
See TracChangeset
for help on using the changeset viewer.