assets_guardian.plugins.dolibarr.constants

Functions

get_permission_label(module,Β permission_key)

Resolves the human-readable label of a Dolibarr permission key.

assets_guardian.plugins.dolibarr.constants.get_permission_label(module: str, permission_key: str) str[source]

Resolves the human-readable label of a Dolibarr permission key.

Traverses DOLIBARR_PERMISSIONS_LABELS following the module path (e.g., "user.user" -> sub-dict user -> sub-dict user), then falls back to the base module if the full path is not found.

Parameters:
  • module – Name of the Dolibarr module, possibly nested (e.g., "user.self").

  • permission_key – Permission key (e.g., "lire", "creer").

Returns:

Permission label, or "{module}.{permission_key}" if not found.

Return type:

str