public void setAuthorizationRules(final List<AuthorizationRule> authorizationRules) { for (final AuthorizationRule authorizationRule : authorizationRules) { authorizationRuleMap.put(authorizationRule.getId(), authorizationRule); } }
protected boolean isAllowedToAccess(final SPageMapping pageMapping, final Map<String, Serializable> context, final List<String> pageAuthorizationRules) throws SExecutionException { boolean authorized = true; for (final String rule : pageAuthorizationRules) { final AuthorizationRule authorizationRule = authorizationRuleMap.get(rule); if (authorizationRule == null) { throw new SExecutionException("Authorization rule " + rule + " is not known. Cannot check if authorized or not."); } if (authorizationRule.isAllowed(pageMapping.getKey(), context)) { return true; } else { authorized = false; } } return authorized; }
protected boolean isAllowedToAccess(final SPageMapping pageMapping, final Map<String, Serializable> context, final List<String> pageAuthorizationRules) throws SExecutionException { boolean authorized = true; for (final String rule : pageAuthorizationRules) { final AuthorizationRule authorizationRule = authorizationRuleMap.get(rule); if (authorizationRule == null) { throw new SExecutionException("Authorization rule " + rule + " is not known. Cannot check if authorized or not."); } if (authorizationRule.isAllowed(pageMapping.getKey(), context)) { return true; } else { authorized = false; } } return authorized; }
public void setAuthorizationRules(final List<AuthorizationRule> authorizationRules) { for (final AuthorizationRule authorizationRule : authorizationRules) { authorizationRuleMap.put(authorizationRule.getId(), authorizationRule); } }