czim/laravel-cms-acl-module

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (0.9.3) of this package.

Laravel CMS: ACL Module

0.9.3 2017-03-20 14:37 UTC

This package is auto-updated.

Last update: 2021-05-09 21:25:41 UTC


README

Simple ACL module for the CMS.

To be used to with the Laravel CMS Core.

Installation

Add the module class to your cms-modules.php configuration file:

    'modules' => [
        // ...
        \Czim\CmsAclModule\AclModule::class,
    ],

Add the service provider to your cms-modules.php configuration file:

    'providers' => [
        // ...
        Czim\CmsAclModule\Providers\CmsAclModuleServiceProvider::class,
        // ...
    ],

To publish the config:

php artisan vendor:publish

Configuration

Available permissions are read from the core's module defined ACL presences.

Any custom permission keys may be added to the cms-acl-module.php configuration file, under permissions:

<?php
    'permissions' => [
        'example.custom.permission',
        'and.another',
    ],

Without further configuration, these will be presented under the header of 'Miscellaneous' in the permissions list selectable for roles.

To assign custom permissions, or even permissions provided by modules to a (new) permission group, use the groups configuration array.

For instance:

<?php
    'groups' => [
        [
            // The type must always be 'group'
            'type'        => 'group',
            // The label will be used for the multiselect optgroup
            'label'            => 'Some Label',
            // Translation key to use for a label for the optgroup. If this is set, the label value is ignored. 
            'label_translated' => 'some.translation.key',
            // Permissions should always be a list of available permission slug strings
            'permissions' => [
                'example.custom.permission',
                'models.app-models-post.show',
            ]
        ]
    ],

This would assign two permissions to a new group.

Any group left without permissions will automatically be hidden, whether it is module defined or not.

For all configuration options, see the configuration file.

API Documentation

The documentation for the ACL module API endpoints: https://czim.github.io/laravel-cms-acl-module

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.