|
dolibarr 25.0.0-alpha
|
Immutable request describing one permissions sync to perform on a module descriptor. More...

Static Public Member Functions | |
| static | forObjectCreation (string $module, string $descriptorFile, array $permissions, string $objectName) |
| Declare the three CRUD rights of a newly generated object. | |
| static | forObjectDeletion (string $module, string $descriptorFile, array $permissions, string $objectName) |
| Drop every right attached to an object being deleted. | |
| static | forRightAddition (string $module, string $descriptorFile, array $permissions, string $objectName, string $label, string $crud) |
| Append one right to the descriptor. | |
| static | forRightUpdate (string $module, string $descriptorFile, array $permissions, int $rightKey, string $objectName, string $label, string $crud) |
| Replace one right, addressed by its index in the rights array. | |
| static | forRightDeletion (string $module, string $descriptorFile, array $permissions, int $rightKey) |
| Remove one right, addressed by its index in the rights array. | |
Private Member Functions | |
| __construct (string $module, string $descriptorFile, array $permissions, string $objectName, string $scope, string $actionType, ?int $rightKey=null, ?string $rightLabel=null, ?string $rightCrud=null) | |
Immutable request describing one permissions sync to perform on a module descriptor.
ModuleBuilder triggers project onto two axes, not one: a scope (the three CRUD rights of an object, or a single right) and an action. The five real triggers are the five named factories below; there is no object-scoped update.
The command deliberately carries the current rights array along with the intent. That keeps RightsSyncService free of $db, dol_include_once() and globals, so it stays unit-testable against a throwaway fixture file.
Definition at line 35 of file RightsSyncCommand.class.php.
|
private |
| string | $module | Module name |
| string | $descriptorFile | Path to the descriptor to patch |
| array<int,array<int,string>> | $permissions Current rights array | |
| string | $objectName | Target object, may be empty for right deletion |
| string | $scope | One of SCOPE_* |
| string | $actionType | One of ACTION_* |
| int | null | $rightKey | Index in $permissions |
| string | null | $rightLabel | Permission label |
| string | null | $rightCrud | Permission crud code |
InvalidArgumentException When the command is incomplete for its scope and action
Definition at line 83 of file RightsSyncCommand.class.php.
|
static |
Declare the three CRUD rights of a newly generated object.
| string | $module | Module name |
| string | $descriptorFile | Path to the descriptor to patch |
| array<int,array<int,string>> | $permissions Current rights array | |
| string | $objectName | Object being generated |
Definition at line 141 of file RightsSyncCommand.class.php.
Referenced by reWriteAllPermissions().
|
static |
Drop every right attached to an object being deleted.
| string | $module | Module name |
| string | $descriptorFile | Path to the descriptor to patch |
| array<int,array<int,string>> | $permissions Current rights array | |
| string | $objectName | Object being deleted |
Definition at line 155 of file RightsSyncCommand.class.php.
Referenced by reWriteAllPermissions().
|
static |
Append one right to the descriptor.
| string | $module | Module name |
| string | $descriptorFile | Path to the descriptor to patch |
| array<int,array<int,string>> | $permissions Current rights array | |
| string | $objectName | Object the right belongs to |
| string | $label | Permission label |
| string | $crud | Permission crud code |
Definition at line 171 of file RightsSyncCommand.class.php.
Referenced by reWriteAllPermissions().
|
static |
Remove one right, addressed by its index in the rights array.
| string | $module | Module name |
| string | $descriptorFile | Path to the descriptor to patch |
| array<int,array<int,string>> | $permissions Current rights array | |
| int | $rightKey | Index of the right to remove |
Definition at line 202 of file RightsSyncCommand.class.php.
Referenced by reWriteAllPermissions().
|
static |
Replace one right, addressed by its index in the rights array.
| string | $module | Module name |
| string | $descriptorFile | Path to the descriptor to patch |
| array<int,array<int,string>> | $permissions Current rights array | |
| int | $rightKey | Index of the right to replace |
| string | $objectName | Object the right belongs to |
| string | $label | New permission label |
| string | $crud | New permission crud code |
Definition at line 188 of file RightsSyncCommand.class.php.
Referenced by reWriteAllPermissions().