NIHVIVO-2694 Add a little flexibility to PolicyHelper

This commit is contained in:
j2blake 2012-02-02 16:57:41 +00:00
parent 78c19dde80
commit 12a1f9342d

View file

@ -48,6 +48,14 @@ public class PolicyHelper {
Actions actions) {
PolicyIface policy = ServletPolicyList.getPolicies(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);
}