RoleManager
RoleManager manages a collection of Role objects, allowing creation and permission management for multiple roles in the PostgreSQL database.
Source code in pum/role_manager.py
__init__
Initialize the RoleManager class.: Args: roles: List of roles or dictionaries defining roles. Each role can be a dictionary with keys 'name', 'permissions', and optional 'description' and 'inherit'.
Source code in pum/role_manager.py
create_roles
Create roles in the database. Args: connection: The database connection to execute the SQL statements. grant: Whether to grant permissions to the roles. Defaults to False. commit: Whether to commit the transaction. Defaults to False.
Source code in pum/role_manager.py
grant_permissions
Grant permissions to the roles in the database. Args: connection: The database connection to execute the SQL statements. commit: Whether to commit the transaction. Defaults to False.