public interface AuthenticationInspector
Authentication, if available. The current
authentication semantic depends on the concrete authentication context to which the inspector is bound.
A list of authorization control methods are provided to perform access control decisions using the current
Authentication.
AuthContext| Modifier and Type | Method and Description |
|---|---|
Optional<Authentication> |
getAuthentication()
Get the current
Authentication, if available. |
default boolean |
isAuthenticated()
Gets whether an
Authentication is available. |
boolean |
isPermitted(Collection<? extends Permission> permissions)
Checks if the current
Authentication has all the specified Permissions. |
default boolean |
isPermitted(Permission... permissions)
Checks if the current
Authentication has all the specified Permissions. |
boolean |
isPermitted(String... permissions)
Checks if the current
Authentication has all the specified permissions, using the String
permission representation. |
boolean |
isPermittedAny(Collection<? extends Permission> permissions)
Checks if the current
Authentication has any of the specified Permission. |
default boolean |
isPermittedAny(Permission... permissions)
Checks if the current
Authentication has any of the specified Permission. |
boolean |
isPermittedAny(String... permissions)
Checks if the current
Authentication has any of the specified permission, using the String
permission representation. |
default Authentication |
requireAuthentication()
Get the current
Authentication, throwing an IllegalStateException if not available. |
Optional<Authentication> getAuthentication()
Authentication, if available.Authentication, or an empty Optional if not available.default Authentication requireAuthentication()
Authentication, throwing an IllegalStateException if not available.Authenticationdefault boolean isAuthenticated()
Authentication is available.true if an Authentication is available, false otherwiseboolean isPermitted(Collection<? extends Permission> permissions)
Authentication has all the specified Permissions.
The permission control strategy depends on the concrete authorization strategy of the current authentication context.
permissions - The permissions to be checkedtrue if the current Authentication has all the specified permission,
false otherwisedefault boolean isPermitted(Permission... permissions)
Authentication has all the specified Permissions.
The permission control strategy depends on the concrete authorization strategy of the current authentication context.
permissions - The permissions to be checkedtrue if the current Authentication has all the specified permission,
false otherwiseboolean isPermitted(String... permissions)
Authentication has all the specified permissions, using the String
permission representation.
The permission control strategy depends on the concrete authorization strategy of the current authentication context.
permissions - The permissions to be checkedtrue if the current Authentication has all the specified permission,
false otherwiseboolean isPermittedAny(Collection<? extends Permission> permissions)
Authentication has any of the specified Permission.
The permission control strategy depends on the concrete authorization strategy of the current authentication context.
permissions - The permissions to be checkedtrue if the current Authentication has any of the specified permission,
false otherwisedefault boolean isPermittedAny(Permission... permissions)
Authentication has any of the specified Permission.
The permission control strategy depends on the concrete authorization strategy of the current authentication context.
permissions - The permissions to be checkedtrue if the current Authentication has any of the specified permission,
false otherwiseboolean isPermittedAny(String... permissions)
Authentication has any of the specified permission, using the String
permission representation.
The permission control strategy depends on the concrete authorization strategy of the current authentication context.
permissions - The permissions to be checkedtrue if the current Authentication has any of the specified permission,
false otherwiseCopyright © 2019 The Holon Platform. All rights reserved.