| 29 | /// to prevent accidentally leaving admin endpoints unprotected. |
| 30 | #[derive(Debug, Clone)] |
| 31 | pub struct AuthzPolicy { |
| 32 | /// Role name that grants admin access. Empty disables admin checks. |
| 33 | pub admin_role: String, |
| 34 | /// Role name that grants standard user access. Empty disables user checks. |
| 35 | pub user_role: String, |
| 36 | /// When true, enforce scope-based permissions on top of roles. |
| 37 | pub scopes_enabled: bool, |
| 38 | } |
| 39 | |
| 40 | impl AuthzPolicy { |
| 41 | /// Validate the policy configuration. |
nothing calls this directly
no outgoing calls
no test coverage detected