management.security.decorators¶
Functions¶
|
A decorator that checks whether a specific security feature is allowed based on the current security level. |
Module Contents¶
- management.security.decorators.security_level(feature_name)[source]¶
A decorator that checks whether a specific security feature is allowed based on the current security level.
This decorator uses the SecurityManager to determine if the provided feature is permitted under the current security level. If the feature is not allowed, it raises a PermissionDenied exception.
Parameters:¶
- feature_nameSecurityFeatures
The feature to check against the current security level.
Returns:¶
- function
The wrapped function that will only execute if the feature is allowed.
Raises:¶
- PermissionDenied
If the security level does not permit the requested feature.
- Parameters:
feature_name (management.security.SecurityFeature)