HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/tracopt/perm/__pycache__/config_perm_provider.cpython-310.pyc
o

�k�`
�@s4ddlTddlmZddlmZGdd�de�ZdS)�)�*)�
ConfigSection)�IPermissionRequestorc@s,eZdZdZee�eddd�Zdd�ZdS)�ExtraPermissionsProviderz�Define 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
        }}}
        )�doccCs�i}|j��D]/\}}dd�|�d�D�}|D]}|�|g�q|����}|r6|�d�s6|�|g��|�qdd�|��D�S)NcSsg|]}|�����qS�)�strip�upper)�.0�eachrr�C/usr/lib/python3/dist-packages/tracopt/perm/config_perm_provider.py�
<listcomp>:szCExtraPermissionsProvider.get_permission_actions.<locals>.<listcomp>�,�_cSs g|]\}}|r||fn|�qSrr)r
�k�vrrrr
@s )	�extra_permissions_section�options�split�
setdefaultrr	�
startswith�extend�items)�self�permissions�meta�perms�permrrr�get_permission_actions7s�z/ExtraPermissionsProvider.get_permission_actionsN)	�__name__�
__module__�__qualname__�__doc__�
implementsrrrrrrrrrs�rN)�	trac.core�trac.configr�	trac.permr�	Componentrrrrr�<module>s