ACL Manager Plugin
ACL Manager is a plugin that provides access control list (ACL) management functionality for the Festi Framework. It allows you to manage permissions across sections and user types through a visual interface.
Requirements
- A Festi project with the Jimbo system plugin.
- The Festi Theme package (
Festi\Theme\Plugin\DisplayPlugin). - A MySQL or PostgreSQL database.
- A user type with the ident
adminin the tableusers_types. The install file gives the permissions to this user type.
The name of the plugin in the project is ACLManage. The plugin class is plugin\ACLManage\ACLManagePlugin.
Installation
Use the Festi CLI to install the plugin. Run the command from the project root:
./vendor/bin/festi-plugin --mode install --path ./src/dashboard/ --dump ./dumps/ \
--plugin ACLManage --repository [email protected]:FestiPlugins/php_festi_plugin_acl.git
This example was not run for this page.
The command does these steps:
- It adds the repository to the plugins directory as the git submodule
ACLManage. - It copies
install/install.<database type>.sqlinto the dumps directory as a new migration. - It applies the migration.
The migration adds the plugin, the URL rules, the sections acl_manage and acl_section_idents, and the permissions of the user type admin.
The plugin has no tables of its own.
Commit the submodule and the new migration together.
Configuration
The plugin has no options in the project configuration.
The install file adds two sections:
| Section | Constant | Function |
|---|---|---|
acl_manage |
ACLManageSections::MANAGE |
Access to the plugin pages. |
acl_section_idents |
ACLManageSections::IDENTS |
Shows the technical permission identifiers on the ACL management page. |
Only the user type admin gets these sections during the installation.
Use the ACL management page to give them to other user types.
Usage
Accessing the Plugin
Get an instance of the plugin through the Core:
$aclPlugin = Core::getInstance()->getPluginInstance('ACLManage');
// or
$aclPlugin = Core::getInstance()->getPluginInstance(ACLManagePlugin::class);
Using Plugin Facades
The plugin provides facades for accessing its functionality:
$plugin = Core::getInstance()->getPluginInstance('ACLManage');
// Get sections facade
$sectionsFacade = $plugin->getSectionsFacade();
$sections = $sectionsFacade->getList();
// Get permissions facade
$permissionsFacade = $plugin->getSectionsPermissionsFacade();
$permissions = $permissionsFacade->getList($userTypeIds);
// Get user types facade
$userTypesFacade = $plugin->getUsersTypesFacade();
$userTypes = $userTypesFacade->getList($workspaceId);
Plugin Routes
The plugin exposes the following routes (when using Jimbo system plugin):
/manage/acl/- Main ACL management interface/manage/acl/apply/- Apply permission changes (JSON)/manage/acl/clone/- Clone a user type and its permissions (JSON)/manage/acl/users-types/- User types management interface
From Another Plugin
Access the plugin from within another plugin:
class MyPlugin extends DisplayPlugin
{
public function someMethod()
{
$aclPlugin = Core::getInstance()->getPluginInstance('ACLManage');
$sections = $aclPlugin->getSectionsFacade()->getList();
}
}
Plugin Features
Sections Management
Manage access control sections that define permission boundaries in your application.
User Types
Define and manage different user types (roles) that can be assigned permissions.
Permissions Matrix
Visual interface for managing permissions across sections and user types, allowing you to:
- View all sections and user types in a matrix
- Give or remove a permission. Each cell is a checkbox: a checked cell gives the full permission (value 6), an unchecked cell removes it.
- Batch update permissions