update auf neuen codeigniter

benutzerverwaltung hinzugefügt
sync scheduled implementiert
This commit is contained in:
Markus
2024-11-26 11:45:22 +01:00
parent eb028d1783
commit de4bd6e366
61 changed files with 1996 additions and 1130 deletions

View File

@@ -2,6 +2,15 @@
declare(strict_types=1);
/**
* This file is part of CodeIgniter Shield.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Config;
use CodeIgniter\Shield\Config\AuthGroups as ShieldAuthGroups;
@@ -20,10 +29,16 @@ class AuthGroups extends ShieldAuthGroups
* --------------------------------------------------------------------
* Groups
* --------------------------------------------------------------------
* The available authentication systems, listed
* with alias and class name. These can be referenced
* by alias in the auth helper:
* auth('api')->attempt($credentials);
* An associative array of the available groups in the system, where the keys
* are the group names and the values are arrays of the group info.
*
* Whatever value you assign as the key will be used to refer to the group
* when using functions such as:
* $user->addGroup('superadmin');
*
* @var array<string, array<string, string>>
*
* @see https://codeigniter4.github.io/shield/quick_start_guide/using_authorization/#change-available-groups for more info
*/
public array $groups = [
'superadmin' => [
@@ -34,17 +49,17 @@ class AuthGroups extends ShieldAuthGroups
'title' => 'Admin',
'description' => 'Day to day administrators of the site.',
],
'developer' => [
'title' => 'Developer',
'description' => 'Site programmers.',
'finanzen' => [
'title' => 'Finanzmanger User',
'description' => 'Buchhaltung.',
],
'user' => [
'title' => 'User',
'description' => 'General users of the site. Often customers.',
],
'beta' => [
'title' => 'Beta User',
'description' => 'Has access to beta-level features.',
'smarthome' => [
'title' => 'Smarthome User',
'description' => 'Kann Smarthome eingeschränkt benutzen.',
],
];
@@ -52,8 +67,7 @@ class AuthGroups extends ShieldAuthGroups
* --------------------------------------------------------------------
* Permissions
* --------------------------------------------------------------------
* The available permissions in the system. Each system is defined
* where the key is the
* The available permissions in the system.
*
* If a permission is not listed here it cannot be used.
*/
@@ -64,20 +78,28 @@ class AuthGroups extends ShieldAuthGroups
'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',
];
'finanzen.view' => 'Can view FinanzManager',
'finanzen.change' => 'Can use FinanzManager',
'smarthome.settings' => 'Can change settings in smarthome',
'smarthome.action' => 'Can switch lights in smarthome',
'smarthome.view' => 'Can view smarthome site',
];
/**
* --------------------------------------------------------------------
* Permissions Matrix
* --------------------------------------------------------------------
* Maps permissions to groups.
*
* This defines group-level permissions.
*/
public array $matrix = [
'superadmin' => [
'admin.*',
'users.*',
'beta.*',
'smarthome.*',
'finanzen.*',
],
'admin' => [
'admin.access',
@@ -86,16 +108,15 @@ class AuthGroups extends ShieldAuthGroups
'users.delete',
'beta.access',
],
'developer' => [
'admin.access',
'admin.settings',
'users.create',
'users.edit',
'beta.access',
'finanzen' => [
'finanzen.view',
'finanzen.change',
],
'user' => [],
'beta' => [
'beta.access',
'user' => [
'smarthome.view',
],
'smarthome' => [
'smarthome.action',
],
];
}