Package trac :: Module attachment :: Class ILegacyAttachmentPolicyDelegate

Class ILegacyAttachmentPolicyDelegate

source code

    object --+    
             |    
core.Interface --+
                 |
                ILegacyAttachmentPolicyDelegate

Interface that can be used by plugins to seamlessly participate to the legacy way of checking for attachment permissions.

This should no longer be necessary once it becomes easier to setup fine-grained permissions in the default permission store.

Instance Methods
 
check_attachment_permission(action, username, resource, perm)
Return the usual True/False/None security policy decision appropriate for the requested action on an attachment.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

check_attachment_permission(action, username, resource, perm)

source code 

Return the usual True/False/None security policy decision appropriate for the requested action on an attachment.

Parameters:
  • action - one of ATTACHMENT_VIEW, ATTACHMENT_CREATE, ATTACHMENT_DELETE
  • username - the user string
  • resource - the ~trac.resource.Resource for the attachment. Note that when ATTACHMENT_CREATE is checked, the resource .id will be None.
  • perm - the permission cache for that username and resource