o k` @s4ddlTddlmZddlmZGdddeZdS))*) ConfigSection)IPermissionRequestorc@s,eZdZdZeeedddZddZdS)ExtraPermissionsProviderzDefine arbitrary permissions. Documentation can be found on the [wiki:TracIni#extra-permissions-section] page after enabling the component.zextra-permissionsa|This section provides a way to add arbitrary permissions to a Trac environment. This can be useful for adding new permissions to use for workflow actions, for example. To add new permissions, create a new section `[extra-permissions]` in your `trac.ini`. Every entry in that section defines a meta-permission and a comma-separated list of permissions. For example: {{{#!ini [extra-permissions] EXTRA_ADMIN = EXTRA_VIEW, EXTRA_MODIFY, EXTRA_DELETE }}} This entry will define three new permissions `EXTRA_VIEW`, `EXTRA_MODIFY` and `EXTRA_DELETE`, as well as a meta-permissions `EXTRA_ADMIN` that grants all three permissions. The permissions are created in upper-case characters regardless of the casing of the definitions in `trac.ini`. For example, the definition `extra_view` would create the permission `EXTRA_VIEW`. If you don't want a meta-permission, start the meta-name with an underscore (`_`): {{{#!ini [extra-permissions] _perms = EXTRA_VIEW, EXTRA_MODIFY }}} )doccCsi}|jD]/\}}dd|dD}|D]}||gq|}|r6|ds6||g|qdd|DS)NcSsg|]}|qS)stripupper).0eachrrC/usr/lib/python3/dist-packages/tracopt/perm/config_perm_provider.py :szCExtraPermissionsProvider.get_permission_actions..,_cSs g|] \}}|r ||fn|qSrr)r kvrrr r @s ) extra_permissions_sectionoptionssplit setdefaultrr startswithextenditems)self permissionsmetapermspermrrr get_permission_actions7s z/ExtraPermissionsProvider.get_permission_actionsN) __name__ __module__ __qualname____doc__ implementsrrrrrrrr rs rN) trac.core trac.configr trac.permr Componentrrrrr s