# You must use a tab-size of 4 spaces to edit this file.
---
#    You can create new admin permissions by defining new fields in the Permissions
#    admin box.
#    
#    To count as an admin permission:
#        - The fields should be placed under zenario_admin/tabs/permissions/fields
#        - The fields should have the "is_admin_permission" property set to true
#        - The fields should be in the "specific_actions" grouping
#    
#    You may have:
#        - A "type: checkbox" field on its own to act as a single permission.
#        - A "type: checkboxes" field on its own to act as a list of
#          permissions.
#        - A "type:" checkboxes field with the "checking_child_checks_parents"
#          property set to act as a list of permissions with hierarchical dependencies.
#        - A "type: checkbox" field immediately followed by a
#          "type: checkboxes: field to act as a list of permissions that can
#          be quickly turned on or off by the first checkbox. This will also add a
#          toggle button to allow the longer list to be hidden.
#    
#    Zenario will then add the CSS, JavaScript, loading logic and saving logic needed.
zenario_admin:
    tabs:
        permissions:
            disable_autofocus: true
            fields:
                perm_author:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkbox
                    value: 1
                    full_width: true
                    post_field_label: Content item authoring
                    label_class: zfab_core_perm
                    redraw_onchange: true
                perm_author_permissions:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkboxes
                    full_width: true
                    checking_child_checks_parents: true
                    values:
                        _PRIV_EDIT_DRAFT:
                            label: Create and edit draft content items
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_MEDIA:
                            label: Upload images and edit their details
                            label_class: zfab_core_perm
                    value: "_PRIV_EDIT_DRAFT,_PRIV_MANAGE_MEDIA"
                    redraw_onchange: true
                
                perm_publish_disabled:
                    is_admin_permission: false
                    grouping: specific_actions
                    visible_if: |
                        !lib.value('perm_author_permissions').match(/_PRIV_EDIT_DRAFT/)
                    type: checkbox
                    disabled: true
                    full_width: true
                    post_field_label: Publish (requires Author permissions)
                    label_class: zfab_core_perm
                    row_class: zenario_perms
                perm_publish:
                    is_admin_permission: true
                    grouping: specific_actions
                    visible_if: |
                        lib.value('perm_author_permissions').match(/_PRIV_EDIT_DRAFT/)
                    type: checkbox
                    value: 1
                    full_width: true
                    post_field_label: Content item publishing, plugins, phrases
                    label_class: zfab_core_perm
                perm_publish_permissions:
                    is_admin_permission: true
                    grouping: specific_actions
                    hide_with_previous_field: true
                    hide_with_previous_previous_field: true
                    type: checkboxes
                    full_width: true
                    checking_child_checks_parents: true
                    values:
                        _PRIV_PUBLISH_CONTENT_ITEM:
                            label: Publish a content item
                            label_class: zfab_core_perm
                        _PRIV_CANCEL_CHECKOUT:
                            label: Unlock a locked content item
                            label_class: zfab_core_perm
                        _PRIV_DELETE_TRASHED_CONTENT_ITEMS:
                            parent: _PRIV_PUBLISH_CONTENT_ITEM
                            label: Empty trash
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_CATEGORY:
                            label: Edit categories
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_EMAIL_TEMPLATE:
                            label: Edit email templates
                            label_class: zfab_core_perm
                        _PRIV_VIEW_REUSABLE_PLUGIN:
                            label: View settings of plugins
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_REUSABLE_PLUGIN:
                            parent: _PRIV_VIEW_REUSABLE_PLUGIN
                            label: Edit settings of plugins
                            label_class: zfab_core_perm
                        _PRIV_VIEW_LANGUAGE:
                            label: View phrases of enabled languages
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_LANGUAGE_PHRASE:
                            parent: _PRIV_VIEW_LANGUAGE
                            label: Edit phrases of enabled languages
                            label_class: zfab_core_perm
                        #_PRIV_MANAGE_DOCUMENTS:
                        #    label: Manage documents
                    value: "_PRIV_PUBLISH_CONTENT_ITEM,_PRIV_CANCEL_CHECKOUT,_PRIV_DELETE_TRASHED_CONTENT_ITEMS,_PRIV_MANAGE_CATEGORY,_PRIV_MANAGE_EMAIL_TEMPLATE,_PRIV_VIEW_LANGUAGE,_PRIV_MANAGE_LANGUAGE_PHRASE,_PRIV_VIEW_REUSABLE_PLUGIN,_PRIV_MANAGE_REUSABLE_PLUGIN"
                
                perm_editmenu_disabled:
                    is_admin_permission: false
                    grouping: specific_actions
                    visible_if: |
                        !lib.value('perm_author_permissions').match(/_PRIV_EDIT_DRAFT/)
                    type: checkbox
                    disabled: true
                    full_width: true
                    post_field_label: Menu (requires Author permissions)
                    label_class: zfab_core_perm
                    row_class: zenario_perms
                perm_editmenu:
                    is_admin_permission: true
                    grouping: specific_actions
                    visible_if: |
                        lib.value('perm_author_permissions').match(/_PRIV_EDIT_DRAFT/)
                    type: checkbox
                    value: 1
                    full_width: true
                    post_field_label: Menu hierarchy
                    label_class: zfab_core_perm
                perm_editmenu_permissions:
                    is_admin_permission: true
                    grouping: specific_actions
                    hide_with_previous_field: true
                    hide_with_previous_previous_field: true
                    type: checkboxes
                    full_width: true
                    checking_child_checks_parents: true
                    values:
                        _PRIV_EDIT_MENU_TEXT:
                            label: Edit a menu node's text
                            label_class: zfab_core_perm
                        _PRIV_EDIT_MENU_ITEM:
                            parent: _PRIV_EDIT_MENU_TEXT
                            label: Edit all of a menu node's properties
                            label_class: zfab_core_perm
                        _PRIV_CREATE_DELETE_MENU_ITEM:
                            parent: _PRIV_EDIT_MENU_ITEM
                            label: Create/delete a menu node
                            label_class: zfab_core_perm
                        _PRIV_REORDER_MENU_ITEM:
                            parent: _PRIV_EDIT_MENU_ITEM
                            label: Move menu nodes in hierarchy
                            label_class: zfab_core_perm
                    value: "_PRIV_EDIT_MENU_TEXT,_PRIV_EDIT_MENU_ITEM,_PRIV_CREATE_DELETE_MENU_ITEM,_PRIV_REORDER_MENU_ITEM"
                
                perm_documents:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkbox
                    value: 1
                    full_width: true
                    post_field_label: Hierarchical documents
                    label_class: zfab_core_perm
                perm_document_permissions:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkboxes
                    full_width: true
                    checking_child_checks_parents: true
                    values:
                        _PRIV_VIEW_DOCUMENTS:
                            label: View documents
                            label_class: zfab_core_perm
                        _PRIV_EDIT_DOCUMENTS:
                            parent: _PRIV_VIEW_DOCUMENTS
                            label: Upload, edit, delete documents
                            label_class: zfab_core_perm
                    value: "_PRIV_VIEW_DOCUMENTS,_PRIV_EDIT_DOCUMENTS"
                
                perm_designer_disabled:
                    is_admin_permission: false
                    grouping: specific_actions
                    visible_if: |
                        !lib.value('perm_author_permissions').match(/_PRIV_EDIT_DRAFT/)
                    type: checkbox
                    disabled: true
                    full_width: true
                    post_field_label: Designer (requires Author permissions)
                    label_class: zfab_core_perm
                    row_class: zenario_perms
                perm_designer:
                    is_admin_permission: true
                    grouping: specific_actions
                    visible_if: |
                        lib.value('perm_author_permissions').match(/_PRIV_EDIT_DRAFT/)
                    type: checkbox
                    value: 1
                    full_width: true
                    post_field_label: Plugins and layouts
                    label_class: zfab_core_perm
                perm_designer_permissions:
                    is_admin_permission: true
                    grouping: specific_actions
                    hide_with_previous_field: true
                    hide_with_previous_previous_field: true
                    type: checkboxes
                    full_width: true
                    checking_child_checks_parents: true
                    values:
                        _PRIV_EDIT_TEMPLATE:
                            label: Edit layouts using Gridmaker
                            label_class: zfab_core_perm
                        _PRIV_EDIT_SITEWIDE:
                            parent: _PRIV_EDIT_TEMPLATE
                            label: Edit site-wide HTML/JS and header/footer
                            label_class: zfab_core_perm
                        _PRIV_VIEW_SLOT:
                            label: |
                                View modules, plugins, nests and slideshows
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_ITEM_SLOT:
                            parent: _PRIV_VIEW_SLOT
                            label: |
                                On content items: insert plugins; edit HTML/JavaScript in <head> and <body>
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_TEMPLATE_SLOT:
                            parent: _PRIV_MANAGE_ITEM_SLOT
                            label: >
                                On layouts and site-wide: insert plugins; edit HTML/JavaScript in <head> and <body>
                            label_class: zfab_core_perm
                    value: "_PRIV_EDIT_TEMPLATE,_PRIV_EDIT_SITEWIDE,_PRIV_VIEW_SLOT,_PRIV_MANAGE_ITEM_SLOT,_PRIV_MANAGE_TEMPLATE_SLOT"
                # The Anonymous Comments Module or the Users Module will unhide these and
                # add permissions here if either is running.
                perm_edit_users:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkbox
                    hidden: true
                    full_width: true
                    post_field_label: Users and contacts
                    label_class: zfab_core_perm
                perm_edit_users_permissions:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkboxes
                    hidden: true
                    full_width: true
                    checking_child_checks_parents: true
                perm_system:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkbox
                    value: 1
                    full_width: true
                    post_field_label: Diagnostics actions 
                    label_class: zfab_core_perm
                perm_system_permissions:
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkboxes
                    full_width: true
                    checking_child_checks_parents: true
                    values:
                        _PRIV_VIEW_DIAGNOSTICS:
                            label: View diagnostics on login
                            label_class: zfab_core_perm
                        _PRIV_APPLY_DATABASE_UPDATES:
                            label: Apply database updates
                            label_class: zfab_core_perm
                        _PRIV_REGENERATE_DOCUMENT_PUBLIC_LINKS:
                            label: Repair document public links
                            label_class: zfab_core_perm
                    value: "_PRIV_VIEW_DIAGNOSTICS,_PRIV_APPLY_DATABASE_UPDATES,_PRIV_REGENERATE_DOCUMENT_PUBLIC_LINKS"
                    
                perm_advanced:
                    ord: 100000
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkbox
                    full_width: true
                    post_field_label: Advanced permissions
                    label_class: zfab_core_perm
                perm_advanced_permissions:
                    ord: 100001
                    is_admin_permission: true
                    grouping: specific_actions
                    type: checkboxes
                    full_width: true
                    checking_child_checks_parents: true
                    values:
                        _PRIV_VIEW_ADMIN:
                            label: View administrators' details
                            label_class: zfab_core_perm
                        _PRIV_EDIT_ADMIN:
                            parent: _PRIV_VIEW_ADMIN
                            label: Edit other administrators' details
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_CREATE_ADMIN:
                            parent: _PRIV_EDIT_ADMIN
                            label: Create another administrator
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_DELETE_ADMIN:
                            parent: _PRIV_VIEW_ADMIN
                            label: Trash another administrator
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_CHANGE_ADMIN_PASSWORD:
                            parent: _PRIV_VIEW_ADMIN
                            label: Change another administrator's password
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_CREATE_DELETE_MENU_SECTION:
                            label: Create/delete a menu section
                            label_class: zfab_core_perm
                        _PRIV_EDIT_CSS:
                            label: Edit skin and plugin CSS
                            label_class: zfab_core_perm
                        _PRIV_VIEW_SITE_SETTING:
                            label: View site settings
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_LANGUAGE_CONFIG:
                            label: Enable languages and edit their settings
                            label_class: zfab_core_perm
                        _PRIV_EDIT_SITE_SETTING:
                            parent: _PRIV_VIEW_SITE_SETTING
                            label: Edit site settings
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_EDIT_CONTENT_TYPE:
                            label: Change content type settings
                            label_class: zfab_core_perm
                        _PRIV_MANAGE_DATASET:
                            label: Manage datasets
                            label_class: zfab_core_perm
                        _PRIV_PROTECT_UNPROTECT_DATASET_FIELD:
                            parent: _PRIV_MANAGE_DATASET
                            label: Protect/unprotect dataset fields
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_RUN_MODULE:
                            label: Start a module
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_RESET_MODULE:
                            label: Uninitialise a module
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_BACKUP_SITE:
                            label: Create a backup of the site
                            label_class: zfab_core_perm
                        _PRIV_RESTORE_SITE:
                            parent: _PRIV_BACKUP_SITE
                            label: Restore the site from a backup
                            label_class: zfab_core_perm zfab_scary_option
                        _PRIV_RESET_SITE:
                            parent: _PRIV_BACKUP_SITE
                            label: Reset the site
                            label_class: zfab_core_perm zfab_scary_option

