Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Action | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| getActions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Security; |
| 4 | |
| 5 | use ReflectionClass; |
| 6 | |
| 7 | /** |
| 8 | * This class defines all actions |
| 9 | * Depending on the user's role, these actions are allowed or forbidden (see ActionVoter class). |
| 10 | */ |
| 11 | class Action |
| 12 | { |
| 13 | /** |
| 14 | * Specific actions. |
| 15 | */ |
| 16 | |
| 17 | // display environment info in navbar |
| 18 | public const string NAVBAR_ENVIRONNEMENT = 'navbar_environnement'; |
| 19 | public const string HOMEPAGE = 'homepage'; |
| 20 | public const string ADMIN_PAGE = 'admin_page'; |
| 21 | public const string ADMIN_LOG = 'admin_log'; |
| 22 | public const string ADMIN_PARAMETER = 'admin_parameter'; |
| 23 | public const string ADMIN_PARAMETER_WRITE = 'admin_parameter_write'; |
| 24 | public const string ADMIN_MAIL_TEST = 'admin_mail_test'; |
| 25 | |
| 26 | /** |
| 27 | * Returns the list of actions defined, in this class, by constants. |
| 28 | * |
| 29 | * @return array<string,mixed> |
| 30 | */ |
| 31 | public static function getActions(): array |
| 32 | { |
| 33 | return (new ReflectionClass(self::class))->getConstants(); |
| 34 | } |
| 35 | } |