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