|
dolibarr 25.0.0-alpha
|
Syncs rights straight into the mod<Module>.class.php descriptor file. More...


Public Member Functions | |
| sync (RightsSyncCommand $cmd) | |
| Apply one sync command to a module descriptor. | |
Private Member Functions | |
| applyCommand (RightsSyncCommand $cmd) | |
| Produce the rights array the descriptor should now declare. | |
| addObjectRights (array $permissions, string $module, string $objectName) | |
| Append the three CRUD rights of a freshly generated object. | |
| removeObjectRights (array $permissions, string $objectName) | |
| Drop every right attached to an object. | |
| addRight (array $permissions, string $objectName, string $label, string $crud) | |
| Append one right, refusing a crud code the object already declares. | |
Syncs rights straight into the mod<Module>.class.php descriptor file.
Error-first: every reason not to write is collected before the rights array is touched, and a single conflict aborts the whole run without writing. A half-written permissions section is worse than a stale one.
Definition at line 49 of file RightsSyncService.class.php.
|
private |
Append the three CRUD rights of a freshly generated object.
| array<int,array<int,string>> | $permissions Current rights | |
| string | $module | Module name |
| string | $objectName | Object being generated |
Definition at line 176 of file RightsSyncService.class.php.
Referenced by applyCommand().
|
private |
Append one right, refusing a crud code the object already declares.
| array<int,array<int,string>> | $permissions Current rights | |
| string | $objectName | Object the right belongs to |
| string | $label | Permission label |
| string | $crud | Permission crud code |
InvalidArgumentException When the object already declares that crud code
Definition at line 231 of file RightsSyncService.class.php.
Referenced by applyCommand().
|
private |
Produce the rights array the descriptor should now declare.
| RightsSyncCommand | $cmd | Command to apply |
InvalidArgumentException When the command targets a right that cannot be addressed
Definition at line 134 of file RightsSyncService.class.php.
References addObjectRights(), addRight(), and removeObjectRights().
Referenced by sync().
|
private |
Drop every right attached to an object.
Filtering, not array_splice() inside a foreach over the same array.
| array<int,array<int,string>> | $permissions Current rights | |
| string | $objectName | Object being deleted |
| array<int,string> | $right Right to keep or drop |
Definition at line 205 of file RightsSyncService.class.php.
Referenced by applyCommand().
| DescriptorRightsSyncService::sync | ( | RightsSyncCommand | $cmd | ) |
Apply one sync command to a module descriptor.
| RightsSyncCommand | $cmd | Command to apply |
Implements RightsSyncService.
Definition at line 73 of file RightsSyncService.class.php.
References applyCommand(), dol_syslog(), and PermissionsBlock\fromFile().