|
dolibarr 25.0.0-alpha
|
Text engine for the BEGIN/END MODULEBUILDER PERMISSIONS section of a module descriptor. More...

Public Member Functions | |
| getInnerBlock () | |
| Raw content between the markers, markers excluded. | |
| detectTextConflicts () | |
| List the reasons why rewriting this block would destroy something. | |
| detectRightsShapeConflicts (array $permissions) | |
| List the rights that cannot be rendered at all. | |
Static Public Member Functions | |
| static | fromFile (string $file) |
| Read a descriptor and locate its permissions block. | |
Private Member Functions | |
| __construct (string $file, string $innerBlock) | |
Text engine for the BEGIN/END MODULEBUILDER PERMISSIONS section of a module descriptor.
Owns everything that touches the raw text of that section: locating it, deciding whether it is safe to rewrite, rendering a new one from a rights array, and writing it back in a single pass.
Definition at line 30 of file PermissionsBlock.class.php.
| string | $file | Path to the descriptor file |
| string | $innerBlock | Content between the markers |
Definition at line 90 of file PermissionsBlock.class.php.
| PermissionsBlock::detectRightsShapeConflicts | ( | array | $permissions | ) |
List the rights that cannot be rendered at all.
| array<int,array<int,string>> | $permissions Rights array to inspect |
Definition at line 194 of file PermissionsBlock.class.php.
| PermissionsBlock::detectTextConflicts | ( | ) |
List the reasons why rewriting this block would destroy something.
Comments are ignored, which is what makes a brand new module — whose block holds the fully commented-out template — rewritable. Everything else must belong to the whitelist: a block that computes its rights (loop, condition, translation call) cannot be reproduced by render() and must never be flattened into static lines.
Definition at line 148 of file PermissionsBlock.class.php.
References $id.
|
static |
Read a descriptor and locate its permissions block.
| string | $file | Path to the mod<Module>.class.php descriptor |
RuntimeException When the file is unreadable or the markers are missing or inverted
Definition at line 103 of file PermissionsBlock.class.php.
References dol_is_file().
Referenced by deletePerms(), and DescriptorRightsSyncService\sync().
| PermissionsBlock::getInnerBlock | ( | ) |
Raw content between the markers, markers excluded.
Definition at line 133 of file PermissionsBlock.class.php.