public class PermissionEvaluatorImpl<S,O> extends Object implements PermissionEvaluator<S,O>
PermissionEvaluator| Modifier and Type | Field and Description |
|---|---|
protected PermissionResolver<S,O> |
permissionResolver |
protected SubjectResolver<S> |
subjectResolver |
| Constructor and Description |
|---|
PermissionEvaluatorImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAllowed(O object,
String action)
Checks if the current subject (according to
SubjectResolver)
is allowed to perform the specified action to the given object. |
boolean |
isAllowed(S subject,
O object,
String action)
Checks if the given subject is allowed to perform the specified action to the given object
|
void |
setPermissionResolver(PermissionResolver<S,O> permissionResolver) |
void |
setSubjectResolver(SubjectResolver<S> subjectResolver) |
protected SubjectResolver<S> subjectResolver
protected PermissionResolver<S,O> permissionResolver
public void setSubjectResolver(SubjectResolver<S> subjectResolver)
public void setPermissionResolver(PermissionResolver<S,O> permissionResolver)
public boolean isAllowed(O object, String action) throws PermissionException
PermissionEvaluatorSubjectResolver)
is allowed to perform the specified action to the given object.isAllowed in interface PermissionEvaluator<S,O>object - the object or ID of the object whose permissions should be checked. If null,
the global permission should be checkedaction - the action the subject wants to perform (not null)PermissionExceptionpublic boolean isAllowed(S subject, O object, String action) throws PermissionException
PermissionEvaluatorisAllowed in interface PermissionEvaluator<S,O>subject - the subject (not null)object - the object or ID of the object whose permissions should be checked. If null,
the global permission should be checkedaction - the action the subject wants to perform (not null)PermissionExceptionCopyright © 2018 CrafterCMS. All rights reserved.