Changes between Version 4 and Version 5 of TracPermissions


Ignore:
Timestamp:
May 17, 2025, 9:26:21 AM (12 months ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracPermissions

    v4 v5  
    66Permissions are managed using the [TracAdmin trac-admin] tool or the ''General / Permissions'' panel in the ''Admin'' tab of the web interface.
    77
    8 In addition to the default permission policy described in this page, it is possible to activate additional permission policies by enabling [TracPlugins plugins] and listing them in [TracIni#trac-permission_policies-option "[trac] permission_policies"]. See TracFineGrainedPermissions for more details.
    9 
    10 Non-authenticated users accessing the system are assigned the name //anonymous//. Assign permissions to the //anonymous// user to set privileges for anonymous/guest users. The parts of Trac that a user does not have privilege for will not be displayed in the navigation.
     8In addition to the default permission policy described in this page, it is possible to activate additional permission policies by enabling plugins and listing them in [TracIni#trac-permission_policies-option "[trac] permission_policies"]. See TracFineGrainedPermissions for more details.
     9
     10Non-authenticated users accessing the system are assigned the name //anonymous//. Assign permissions to the //anonymous// user to set privileges for anonymous/guest users. The parts of Trac that a user does not have privileges for will not be displayed in the navigation bar.
    1111In addition to these privileges, users can be granted additional individual rights in effect when authenticated and logged into the system. All logged in users belong to the virtual group //authenticated//, which inherits permissions from //anonymous//.
    1212
     
    1818}}}
    1919
    20 Then, the user `bob` will be able to see the Admin tab, and can access the permissions menu. This menu will allow you to perform all the following actions, but from the browser rather than requiring root access to the server. '''Use at least one lowercase character in user names, as all-uppercase names are reserved for permissions.'''
     20Then, the user `bob` will be able to see the Admin tab, and can access the permissions menu. This menu allows you to perform the following actions, but from the browser rather than requiring root access to the server. '''Use at least one lowercase character in user names, as all-uppercase names are reserved for permissions.'''
    2121
    2222[[Image(htdocs:../common/guide/admin.png)]]
     
    3030== Available Privileges
    3131
    32 To enable all privileges for a user, use the `TRAC_ADMIN` permission. This permission is like being `root` on a *NIX system: it will allow you to perform any operation.
     32To enable all privileges for a user, use the `TRAC_ADMIN` permission. This permission is like being `root` on a *NIX system: it will allow you to perform any operation on Trac.
    3333
    3434Otherwise, individual privileges can be assigned to users for the different functional areas of Trac and '''note that the privilege names are uppercase''':
     
    4545|| `TICKET_VIEW` || View existing [TracTickets tickets] and perform [TracQuery ticket queries] ||
    4646|| `TICKET_CREATE` || Create new [TracTickets tickets] ||
    47 || `TICKET_APPEND` || Add comments or attachments to [TracTickets tickets] ||
    48 || `TICKET_CHGPROP` || Modify [TracTickets ticket] properties (priority, assignment, keywords, etc.) with the following exceptions: edit description field, add/remove other users from cc field when logged in ||
     47|| `TICKET_APPEND` || Add comments and attachments to [TracTickets tickets], and edit description of ticket that the user created ||
     48|| `TICKET_CHGPROP` || Modify [TracTickets ticket] properties (priority, assignment, keywords, etc.) with the following exceptions: edit description of tickets created by others, add/remove other users from cc field when logged in ||
    4949|| `TICKET_MODIFY` || Includes both `TICKET_APPEND` and `TICKET_CHGPROP`, and in addition allows resolving [TracTickets tickets] in the [TracWorkflow default workflow]. Tickets can be assigned to users through a [TracTickets#Assign-toasDrop-DownList drop-down list] when the list of possible owners has been restricted. ||
    5050|| `TICKET_EDIT_CC` || Full modify cc field ||
    51 || `TICKET_EDIT_DESCRIPTION` || Modify description field ||
     51|| `TICKET_EDIT_DESCRIPTION` || Modify description field. User with `TICKET_APPEND` or `TICKET_CHGPROP` can modify description of ticket they created. ||
    5252|| `TICKET_EDIT_COMMENT` || Modify another user's comments. Any user can modify their own comments by default. ||
    5353|| `TICKET_BATCH_MODIFY` || [TracBatchModify Batch modify] tickets ||
     
    6262|| `MILESTONE_ADMIN` || All `MILESTONE_*` permissions ||
    6363|| `ROADMAP_VIEW` || View the [TracRoadmap roadmap] page, which is not yet the same as MILESTONE_VIEW, see [trac:#4292 #4292] ||
    64 || `ROADMAP_ADMIN` || to be removed with [trac:#3022 #3022], replaced by MILESTONE_ADMIN ||
     64|| `ROADMAP_ADMIN` || To be removed with [trac:#3022 #3022], replaced by MILESTONE_ADMIN ||
    6565
    6666=== Reports
     
    9595|| `EMAIL_VIEW` || Shows email addresses even if [TracIni#trac-section trac show_email_addresses] configuration option is false ||
    9696
     97== Attachment Permissions
     98
     99Attachment permissions are handled by `LegacyAttachmentPolicy`, and unlike the permissions discussed so far, the permissions provided by `LegacyAttachmentPolicy` are not directly granted. Rather, the ability to create, view and delete attachments is determined by the attachment's parent realm and permissions that the user possesses for that realm.
     100
     101The attachment actions are determined by the following permissions in the ticket, wiki and milestone realms:
     102{{{#!table class="listing"
     103||= Granted By: =||= Ticket =||= Wiki =||= Milestone =||
     104|| `ATTACHMENT_CREATE` || `TICKET_APPEND` || `WIKI_MODIFY` || `MILESTONE_MODIFY` ||
     105|| `ATTACHMENT_VIEW` || `TICKET_VIEW` || `WIKI_VIEW` || `MILESTONE_VIEW` ||
     106|| `ATTACHMENT_DELETE` || `TICKET_ADMIN` || `WIKI_DELETE` || `MILESTONE_DELETE` ||
     107}}}
     108
     109An authenticated user can delete an attachment //they added// without possessing the permission that grants `ATTACHMENT_DELETE`.
     110
     111If explicit attachment permissions are preferred, then `ATTACHMENT_CREATE`, `ATTACHMENT_DELETE` and `ATTACHMENT_VIEW` can be created using the [trac:ExtraPermissionsProvider]. The simplest implementation is to simply define the actions:
     112{{{#!ini
     113[extra-permissions]
     114_perms = ATTACHMENT_CREATE, ATTACHMENT_DELETE, ATTACHMENT_VIEW
     115}}}
     116
     117An alternative configuration adds an `ATTACHMENT_ADMIN` meta-permission that grants the other 3 permissions:
     118{{{#!ini
     119[extra-permissions]
     120ATTACHMENT_ADMIN = ATTACHMENT_CREATE, ATTACHMENT_DELETE, ATTACHMENT_VIEW
     121}}}
     122
     123The explicit permissions can be used in conjunction with `LegacyAttachmentPolicy`, or `LegacyAttachmentPolicy` can be removed from `permission_policies`, in which case only users that have been explicitly granted the corresponding attachment actions will be able to create, delete and view attachments.
     124
    97125== Granting Privileges
    98126
    99 You grant privileges to users using [TracAdmin trac-admin]. The current set of privileges can be listed with the following command:
     127Privileges are granted to users through [TracAdmin trac-admin]. The current set of privileges can be listed with the following command:
    100128{{{#!sh
    101129$ trac-admin /path/to/projenv permission list
     
    123151Any user who has logged in is also in the //authenticated// group.
    124152The //authenticated// group inherits permissions from the //anonymous// group.
    125 For example, if the //anonymous// group has permission WIKI_MODIFY, it is not necessary to add the WIKI_MODIFY permission to the //authenticated// group as well.
     153For example, if the //anonymous// group has permission `WIKI_MODIFY`, it is not necessary to add the `WIKI_MODIFY` permission to the //authenticated// group as well.
    126154
    127155Custom groups may be defined that inherit permissions from the two built-in groups.
     
    139167
    140168== Adding a New Group and Permissions
     169
    141170Permission groups can be created by assigning a user to a group you wish to create, then assign permissions to that group.
    142171
     
    174203== Default Permissions
    175204
    176 By default on a new Trac installation, the //anonymous// user will have ''view'' access to everything in Trac, but will not be able to create or modify anything.
    177 On the other hand, the //authenticated// users will have the permissions to ''create and modify tickets and wiki pages''.
     205By default on a new Trac installation, the //anonymous// user has ''view'' access to everything in Trac, but is not able to create or modify anything.
     206The //authenticated// user has the permissions to ''create and modify tickets and wiki pages''.
    178207
    179208//**anonymous**//
    180209{{{
    181 BROWSER_VIEW 
    182 CHANGESET_VIEW 
    183 FILE_VIEW 
    184 LOG_VIEW 
    185 MILESTONE_VIEW 
    186 REPORT_SQL_VIEW 
    187 REPORT_VIEW 
    188 ROADMAP_VIEW 
    189 SEARCH_VIEW 
    190 TICKET_VIEW 
     210BROWSER_VIEW
     211CHANGESET_VIEW
     212FILE_VIEW
     213LOG_VIEW
     214MILESTONE_VIEW
     215REPORT_SQL_VIEW
     216REPORT_VIEW
     217ROADMAP_VIEW
     218SEARCH_VIEW
     219TICKET_VIEW
    191220TIMELINE_VIEW
    192221WIKI_VIEW
     
    195224//**authenticated**//
    196225{{{
    197 TICKET_CREATE
    198 TICKET_MODIFY
    199 WIKI_CREATE
    200 WIKI_MODIFY 
    201 }}}
     226TICKET_CREATE
     227TICKET_MODIFY
     228WIKI_CREATE
     229WIKI_MODIFY
     230}}}
     231
    202232----
    203233See also: TracAdmin, TracFineGrainedPermissions