Interface Filter
-
@ProviderType public interface Filter
Interface that allows to define the principals for which principal based access control management and permission evaluation can be executed. For any other principals this module would never take effect.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canHandle(@NotNull Set<Principal> principals)
Reveals if this filter implementation is able to handle the given set of principals.@NotNull String
getOakPath(@NotNull Principal validPrincipal)
Returns the Oak path of theTree
to which the policy for the givenvalidPrincipal
will be bound.@Nullable Principal
getValidPrincipal(@NotNull String oakPath)
Retrieves theItemBasedPrincipal
for the givenoakPath
and returns it if it is considered valid by theFilter
implementation.
-
-
-
Method Detail
-
canHandle
boolean canHandle(@NotNull @NotNull Set<Principal> principals)
Reveals if this filter implementation is able to handle the given set of principals.- Parameters:
principals
- A set of principals.- Returns:
true
if the principals can be dealt with by this filter implementation,false
otherwise.
-
getOakPath
@NotNull @NotNull String getOakPath(@NotNull @NotNull Principal validPrincipal)
Returns the Oak path of theTree
to which the policy for the givenvalidPrincipal
will be bound. This method can rely on the fact that the given principal has beenvalidated
before and is not expected to validate the principal.- Parameters:
validPrincipal
- A valid principal i.e. that has been validated throughcanHandle(Set)
.- Returns:
- The absolute oak path to an exiting
Tree
. The policy for the given principal will be bound to that tree. - Throws:
IllegalArgumentException
- If the specified principal is not validated/valid.
-
getValidPrincipal
@Nullable @Nullable Principal getValidPrincipal(@NotNull @NotNull String oakPath)
Retrieves theItemBasedPrincipal
for the givenoakPath
and returns it if it is considered valid by theFilter
implementation. Otherwise this method returnsnull
.- Parameters:
oakPath
- A non-null Oak path pointing to anItemBasedPrincipal
.- Returns:
- A valid principal or
null
if no valid principal can be retrieved/exists for the given path.
-
-