Coverage for src/lexigram/admin/settings/panel/rbac_spec.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-21 14:56 +0800

1"""RBAC configuration specification.""" 

2 

3from __future__ import annotations 

4 

5from lexigram.admin.settings.panel.models import RbacSettings 

6from lexigram.admin.settings.panel.nodes import PydanticConfigSpec 

7from lexigram.admin.settings.panel.registry import ConfigRegistry 

8 

9__all__ = ["RBACSpec", "register_spec"] 

10 

11 

12class RBACSpec(PydanticConfigSpec): 

13 """RBAC configuration spec.""" 

14 

15 namespace = "admin.rbac" 

16 label = "Access Control (RBAC)" 

17 icon = "shield-check" 

18 description = "Default role and anonymous access policy." 

19 model = RbacSettings 

20 required_permissions = frozenset({"admin.settings.edit"}) 

21 

22 

23def register_spec(registry: ConfigRegistry) -> None: 

24 """Register this spec with the config registry.""" 

25 registry.register_spec(RBACSpec)