NIHVIVO-2694 Add a little flexibility to PolicyHelper
This commit is contained in:
parent
78c19dde80
commit
12a1f9342d
1 changed files with 8 additions and 0 deletions
|
@ -48,6 +48,14 @@ public class PolicyHelper {
|
||||||
Actions actions) {
|
Actions actions) {
|
||||||
PolicyIface policy = ServletPolicyList.getPolicies(req);
|
PolicyIface policy = ServletPolicyList.getPolicies(req);
|
||||||
IdentifierBundle ids = RequestIdentifiers.getIdBundleForRequest(req);
|
IdentifierBundle ids = RequestIdentifiers.getIdBundleForRequest(req);
|
||||||
|
return isAuthorizedForActions(ids, policy, actions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are these actions authorized for these identifiers by these policies?
|
||||||
|
*/
|
||||||
|
public static boolean isAuthorizedForActions(IdentifierBundle ids,
|
||||||
|
PolicyIface policy, Actions actions) {
|
||||||
return Actions.notNull(actions).isAuthorized(policy, ids);
|
return Actions.notNull(actions).isAuthorized(policy, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue