lispa/amos-privileges

此包的最新版本(1.3.1)没有提供许可证信息。

AMOS 权限管理插件(角色、权限、域等)

1.3.1 2023-05-23 11:18 UTC

README

Amos Privileges 模块

这个仓库是做什么的?

此仓库用于允许具有管理员角色的用户查看和管理用户权限(rbac 角色、权限和自定义权限,例如如果存在 cwh)。

如何设置?

使用 composer 下载,将其添加到您的 composer json 文件中

"open20/amos-privileges": "dev-master",

在 modules-amos.php 中启用 Privileges 模块,添加

'privileges' => [
    'class' => 'open20\amos\privileges\AmosPrivileges',
]

将权限迁移添加到控制台模块(console/config/migrations-amos.php)

'@vendor/open20/amos-privileges/src/migrations',

可以覆盖一些模块属性

/**
 * @var array roles that must not be considered by Privileges module
 */
public $blackListRoles = ['AMMINISTRATORE_CRTT'];
/**
 * @var array if set, consider only the roles in this list
 */
public $whiteListRoles = [];
/**
 * @var array array of modules for which privileges are not considered
 */
public $blackListModules = ['inforeq'];
/**
 * @var array list of platform roles (not from a single plugin) - override this if necessary
 */
public $platformRoles = ['ADMIN', 'BASIC_USER'];

第一个属性的覆盖示例

'privileges' => [
    'class' => 'open20\amos\privileges\AmosPrivileges',
    'blackListRoles' => [ 'ROLEA' , 'ROLEB' ]
]