czim / laravel-cms-acl-module
Laravel CMS: ACL Module
Installs: 1 956
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
Requires (Dev)
- czim/laravel-cms-core: ~1.3
- mockery/mockery: 0.9.*
- orchestra/testbench: ~3.0
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
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.