management.security.decoratorsΒΆ

Management app decorators.

AttributesΒΆ

F

FunctionsΒΆ

security_level(feature)

A decorator that checks whether a specific security feature is allowed based on the current security level.

Module ContentsΒΆ

management.security.decorators.F[source]ΒΆ
management.security.decorators.security_level(feature)[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 (type[management.security.features.SecurityFeature] | management.security.features.SecurityFeature) – The feature class or instance to check against the current security level.

Returns:

The decorated function that will only execute if the feature is allowed.

Raises:

PermissionDenied – If the security level does not permit the requested feature.

Return type:

collections.abc.Callable[[F], F]