Context Navigation

Fine grained permissions

Before Trac 0.11, it was only possible to define fine-grained permissions checks on the repository browser sub-system.

Since 0.11, there's a general mechanism in place that allows custom permission policy plugins to grant or deny any action on any kind of Trac resources, even at the level of specific versions of such resources.

Permission Policies

AuthzPolicy

An example policy based on an Authz-style system has been added. See
[source:trunk/sample-plugins/permissions/authz_policy.py] for details. (See also [source:trunk/sample-plugins/permissions] for more samples.)

Note that the order in which permission policies are specified is quite critical,
as policies will be examined in the sequence provided.

A policy will return either True, False or None for a given permission check.
Only if the return value is None will the next permission policy be consulted.
If no policy explicitly grants the permission, the final result will be False
(i.e. no permission).

All versions of WikiStart will be viewable by everybody (including anonymous)

PrivatePage will be viewable only by john

other pages will be viewable only by john and jack

mod_authz_svn-like permission policy

At the time of this writing, the old fine grained permissions system from Trac 0.10 and before used for restricting access to the repository has not yet been converted to a permission policy component, but from the user point of view, this makes little if no differences.

That kind of fine-grained permission control needs a definition file, which is the one used by Subversion's mod_authz_svn.
More information about this file format and about its usage in Subversion is available in the Subversion Book (Per-Directory Access Control).