mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadido helper para crear los archivos de costantes de RBAC
This commit is contained in:
@ -14,6 +14,8 @@ declare(strict_types=1);
|
||||
namespace Config;
|
||||
|
||||
require "RBAC/roles.php";
|
||||
require "RBAC/permissions.php";
|
||||
require "RBAC/permissionMatrix.php";
|
||||
|
||||
use CodeIgniter\Shield\Config\AuthGroups as ShieldAuthGroups;
|
||||
|
||||
@ -25,7 +27,7 @@ class AuthGroups extends ShieldAuthGroups
|
||||
* --------------------------------------------------------------------
|
||||
* The group that a newly registered user is added to.
|
||||
*/
|
||||
public string $defaultGroup = 'user';
|
||||
public string $defaultGroup = 'cliente';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------
|
||||
@ -52,16 +54,7 @@ class AuthGroups extends ShieldAuthGroups
|
||||
*
|
||||
* If a permission is not listed here it cannot be used.
|
||||
*/
|
||||
public array $permissions = [
|
||||
'admin.access' => 'Can access the sites admin area',
|
||||
'admin.settings' => 'Can access the main site settings',
|
||||
'users.manage-admins' => 'Can manage other admins',
|
||||
'users.list' => 'Can list user stuff',
|
||||
'users.create' => 'Can create new non-admin users',
|
||||
'users.edit' => 'Can edit existing non-admin users',
|
||||
'users.delete' => 'Can delete existing non-admin users',
|
||||
'beta.access' => 'Can access beta-level features',
|
||||
];
|
||||
public array $permissions = SK_PERMISSIONS;
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------
|
||||
@ -71,31 +64,5 @@ class AuthGroups extends ShieldAuthGroups
|
||||
*
|
||||
* This defines group-level permissions.
|
||||
*/
|
||||
public array $matrix = [
|
||||
"superadmin"=> [
|
||||
"admin.*",
|
||||
"users.*",
|
||||
"beta.*"
|
||||
],
|
||||
"admin"=> [
|
||||
"admin.access",
|
||||
"users.create",
|
||||
"users.edit",
|
||||
"users.delete",
|
||||
"beta.access"
|
||||
],
|
||||
"developer"=> [
|
||||
"admin.access",
|
||||
"admin.settings",
|
||||
"users.create",
|
||||
"users.edit",
|
||||
"beta.access"
|
||||
],
|
||||
"user"=> [
|
||||
"users.list"
|
||||
],
|
||||
"beta"=> [
|
||||
"beta.access"
|
||||
]
|
||||
];
|
||||
public array $matrix = SK_PERMISSION_MATRIX;
|
||||
}
|
||||
Reference in New Issue
Block a user