Interface ActionAuthorizationService<U>
- Type Parameters:
U- the application's subject type
- All Known Implementing Classes:
StaticActionAuthorizationService
public interface ActionAuthorizationService<U>
SPI for fine-grained action checks.
Two complementary entry points map to the canonical Vaadin pattern:
isAllowed(Object, ActionPermission)drives UI state (visibility, enablement, menu rendering).requireAllowed(Object, ActionPermission)is the authoritative server-side guard called immediately before a mutating or sensitive action runs.
The second check is mandatory — UI-level visibility is convenience, never the actual access control.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisAllowed(U subject, ActionPermission permission) default voidrequireAllowed(U subject, ActionPermission permission) ThrowsAccessDeniedExceptionif the subject is not allowed.
-
Method Details
-
isAllowed
- Parameters:
subject- the calling subject (may benull)permission- the action permission to evaluate- Returns:
trueifsubjectmay executepermission
-
requireAllowed
ThrowsAccessDeniedExceptionif the subject is not allowed. Implementations should additionally publish anActionDeniedaudit event in this case.- Parameters:
subject- the calling subject (may benull)permission- the action permission to enforce
-