Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| AuthGroups | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** |
| 6 | * This file is part of CodeIgniter Shield. |
| 7 | * |
| 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> |
| 9 | * |
| 10 | * For the full copyright and license information, please view |
| 11 | * the LICENSE file that was distributed with this source code. |
| 12 | */ |
| 13 | |
| 14 | namespace Config; |
| 15 | |
| 16 | use CodeIgniter\Shield\Config\AuthGroups as ShieldAuthGroups; |
| 17 | |
| 18 | class AuthGroups extends ShieldAuthGroups |
| 19 | { |
| 20 | /** |
| 21 | * -------------------------------------------------------------------- |
| 22 | * Default Group |
| 23 | * -------------------------------------------------------------------- |
| 24 | * The group that a newly registered user is added to. |
| 25 | */ |
| 26 | public string $defaultGroup = 'parent'; |
| 27 | |
| 28 | /** |
| 29 | * -------------------------------------------------------------------- |
| 30 | * Groups |
| 31 | * -------------------------------------------------------------------- |
| 32 | * An associative array of the available groups in the system, where the keys |
| 33 | * are the group names and the values are arrays of the group info. |
| 34 | * |
| 35 | * Whatever value you assign as the key will be used to refer to the group |
| 36 | * when using functions such as: |
| 37 | * $user->addGroup('superadmin'); |
| 38 | * |
| 39 | * @var array<string, array<string, string>> |
| 40 | * |
| 41 | * @see https://codeigniter4.github.io/shield/quick_start_guide/using_authorization/#change-available-groups for more info |
| 42 | */ |
| 43 | public array $groups = [ |
| 44 | 'admin' => [ |
| 45 | 'title' => 'Admin', |
| 46 | 'description' => 'Administratori cu acces complet la platforma.', |
| 47 | ], |
| 48 | 'coach' => [ |
| 49 | 'title' => 'Coach', |
| 50 | 'description' => 'Antrenori cu acces la copiii si grupele proprii.', |
| 51 | ], |
| 52 | 'parent' => [ |
| 53 | 'title' => 'Parent', |
| 54 | 'description' => 'Rol pregatit pentru extindere ulterioara.', |
| 55 | ], |
| 56 | ]; |
| 57 | |
| 58 | /** |
| 59 | * -------------------------------------------------------------------- |
| 60 | * Permissions |
| 61 | * -------------------------------------------------------------------- |
| 62 | * The available permissions in the system. |
| 63 | * |
| 64 | * If a permission is not listed here it cannot be used. |
| 65 | */ |
| 66 | public array $permissions = [ |
| 67 | 'admin.access' => 'Can access the sites admin area', |
| 68 | 'dashboard.view' => 'Can access the dashboard', |
| 69 | 'children.view' => 'Can access children area', |
| 70 | 'attendance.manage' => 'Can operate attendance', |
| 71 | 'evaluations.manage' => 'Can manage evaluations', |
| 72 | ]; |
| 73 | |
| 74 | /** |
| 75 | * -------------------------------------------------------------------- |
| 76 | * Permissions Matrix |
| 77 | * -------------------------------------------------------------------- |
| 78 | * Maps permissions to groups. |
| 79 | * |
| 80 | * This defines group-level permissions. |
| 81 | */ |
| 82 | public array $matrix = [ |
| 83 | 'admin' => [ |
| 84 | 'admin.access', |
| 85 | 'dashboard.view', |
| 86 | 'children.view', |
| 87 | 'attendance.manage', |
| 88 | 'evaluations.manage', |
| 89 | ], |
| 90 | 'coach' => [ |
| 91 | 'dashboard.view', |
| 92 | 'children.view', |
| 93 | 'attendance.manage', |
| 94 | 'evaluations.manage', |
| 95 | ], |
| 96 | 'parent' => [], |
| 97 | ]; |
| 98 | } |