| 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 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 || |
| | 96 | |
| | 97 | == Attachment Permissions |
| | 98 | |
| | 99 | Attachment 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 the user possesses for that realm. |
| | 100 | |
| | 101 | The attachment actions are determined by the following |
| | 102 | permissions in the ticket, wiki and milestone realms: |
| | 103 | {{{#!table class="listing" |
| | 104 | ||= Granted By: =||= Ticket =||= Wiki =||= Milestone =|| |
| | 105 | || `ATTACHMENT_CREATE` || `TICKET_APPEND` || `WIKI_MODIFY` || `MILESTONE_MODIFY` || |
| | 106 | || `ATTACHMENT_VIEW` || `TICKET_VIEW` || `WIKI_VIEW` || `MILESTONE_VIEW` || |
| | 107 | || `ATTACHMENT_DELETE` || `TICKET_ADMIN` || `WIKI_DELETE` || `MILESTONE_DELETE` || |
| | 108 | }}} |
| | 109 | |
| | 110 | If explicit attachment permissions are preferred, `ATTACHMENT_CREATE`, `ATTACHMENT_DELETE` and `ATTACHMENT_VIEW` can be created using the [trac:ExtraPermissionsProvider]. The simplest implementation is to simply define the actions. |
| | 111 | {{{#!ini |
| | 112 | [extra-permissions] |
| | 113 | _perms = ATTACHMENT_CREATE, ATTACHMENT_DELETE, ATTACHMENT_VIEW |
| | 114 | }}} |
| | 115 | |
| | 116 | An alternative configuration adds an `ATTACHMENT_ADMIN` meta-permission that grants the other 3 permission. |
| | 117 | {{{#!ini |
| | 118 | [extra-permissions] |
| | 119 | ATTACHMENT_ADMIN = ATTACHMENT_CREATE, ATTACHMENT_DELETE, ATTACHMENT_VIEW |
| | 120 | }}} |
| | 121 | |
| | 122 | The explicit permissions can be used in concert 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. |