Role manager
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
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
__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(connection: Connection, grant: bool = False, commit: bool = False, feedback: Optional[Feedback] = None) -> None
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. feedback: Optional feedback object for progress reporting.
Source code in pum/role_manager.py
grant_permissions
grant_permissions(connection: Connection, commit: bool = False, feedback: Optional[Feedback] = None) -> None
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. feedback: Optional feedback object for progress reporting.