Changes between Initial Version and Version 1 of TracPermissionFilterPlugin


Ignore:
Timestamp:
Oct 27, 2011, 1:46:19 PM (12 years ago)
Author:
Sergio Talens-Oliag
Comment:

New hack TracPermissionFilterPlugin, created by sto

Legend:

Unmodified
Added
Removed
Modified
  • TracPermissionFilterPlugin

    v1 v1  
     1[[PageOutline(2-5,Contents,pullout)]]
     2
     3= TracPermissionFilter =
     4
     5== Description ==
     6
     7Plugin to remove Trac permissions using a blacklist and/or a whitelist.
     8
     9This hack was born to be able to ''archive'' projects without touching the
     10Trac database, the idea is to use the filter to disable all permissions that
     11allow users to modify it without changing their permissions on the database
     12and be able to restore the project to the original state simply disabling the
     13filter.
     14
     15To filter permissions as desired the plugin has to be the first one on the
     16`permission_policy` list and it works as follows:
     17
     18 1. If the `blacklist` is available and the permission being considered is on
     19    the list the `check_permission` function returns `False` and the
     20    permission evaluation stops.
     21
     22 2. If the `whitelist` is available and the permission we are checking is not
     23    on the list the `check_permission` function returns `False` and the
     24    permission evaluation stops.
     25
     26 3. If the evaluation gets here the permission is ignored by the plugin and
     27    the next permission policy is checked.
     28
     29
     30== Bugs/Feature Requests ==
     31
     32Existing bugs and feature requests for TracPermissionFilterPlugin are
     33[report:9?COMPONENT=TracPermissionFilterPlugin here].
     34
     35If you have any issues, create a
     36[http://trac-hacks.org/newticket?component=TracPermissionFilterPlugin&owner=sto new ticket].
     37
     38== Download ==
     39
     40Download the zipped source from [download:tracpermissionfilterplugin here].
     41
     42== Source ==
     43
     44You can check out TracPermissionFilterPlugin from [http://trac-hacks.org/svn/tracpermissionfilterplugin here] using Subversion, or [source:tracpermissionfilterplugin browse the source] with Trac.
     45
     46== Example ==
     47
     48After enabling the plugin in your `trac.ini`:
     49
     50{{{
     51tracpermissionfilter.* = enabled
     52}}}
     53
     54Add a section with the list of permissions to allow:
     55
     56{{{
     57[permission-filter]
     58whitelist = BROWSER_VIEW,CHANGESET_VIEW,FILE_VIEW,LOG_VIEW,MILESTONE_VIEW,REPORT_SQL_VIEW,REPORT_VIEW,ROADMAP_VIEW,SEARCH_VIEW,TICKET_VIEW,TIMELINE_VIEW,WIKI_VIEW
     59}}}
     60
     61or a list of permissions to deny:
     62
     63{{{
     64[permission-filter]
     65blacklist = BROWSER_VIEW
     66}}}
     67
     68And remember to put the filter the first on your project `permission_policies`:
     69
     70{{{
     71[trac]
     72permission_policies = PermissionFilter, DefaultPermissionPolicy
     73}}}
     74
     75
     76== Recent Changes ==
     77
     78[[ChangeLog(tracpermissionfilterplugin, 3)]]
     79
     80== Author/Contributors ==
     81
     82'''Author:''' [wiki:sto] [[BR]]
     83'''Maintainer:''' [wiki:sto] [[BR]]
     84'''Contributors:'''