Version 1 (modified by 13 years ago) ( diff ) | ,
---|
Extension Point : IPermissionPolicy
Interface | IPermissionPolicy | Since | 0.11 |
Module | trac.perm | Source | perm.py |
The IPermissionPolicy implementations define policies for how to check for (fine grained) permissions.
Purpose
The TracPermissions system defines coarse permissions to control which users have access to which modules. TracFineGrainedPermissions introduced more fine grained control over permissions for individual resources. The IPermissionPolicy interface is used to implement this new system, re-implement the legacy behavior and allow plugins to extend the permission policies.
Usage
Implementing the interface follows the standard guidelines found in TracDev/ComponentArchitecture and of course TracDev/PluginDevelopment.
Only the permission_policies configured in trac.ini will be used (in that order).
Examples
See #DebugPolicy, #PublicWikiPolicy, #SecurityTicketsPolicy
Available Implementations
trac.perm.DefaultPermissionPolicy
Reimplements the pre-0.11 behavior which checks for the traditional coarse grained style permissions described in TracPermissions.
trac.attachment.LegacyAttachmentPolicy
Reimplements the legacy coarse grained permissions checks for attachments, by mapping ATTACHMENT_* permissions to realm specific ones. Allows other plugins to participate in this by implementing ILegacyAttachmentPolicyDelegate.
tracopt.perm.authz_policy.AuthzPolicy
See TracFineGrainedPermissions
trac.versioncontrol.svn_authz.AuthzSourcePolicy
See TracFineGrainedPermissions
sample-plugins.permissions.debug_perm.DebugPolicy
A sample plugin that is only useful for Trac Development. It verifies the well-formedness of the permission checks.
sample-plugins.permissions.public_wiki_policy.PublicWikiPolicy
A sample plugin that allows public access to some wiki pages, illustrating how to check permission on realms.
sample-plugins.permissions.vulnerability_tickets.SecurityTicketsPolicy
A sample plugin that prevents public access to security sensitive tickets.