SecurityUtils { public static boolean checkAuthorizationForSome(Securable securable, Set<Action> actions, Authority authorization) { if (actions.size() == 0) return true; for (Action action : actions) { if (checkAuthorization(securable, action, authorization)) { return true; } } return false; } private  SecurityUtils(); static void setConfigured(boolean configured); static boolean isConfigured(); static void setEnabled(boolean enabled); static boolean isEnabled(); static void setUser(User user); static User getUser(); static void setSite(Site site); static Site getSite(); static boolean isAuthenticated(User user); static boolean userHasRole(User user, Role role); static boolean userHasRole(User user, String roleId); static boolean userHasPermission(User user, Securable securable,
      Action action); static Role[] getRoles(User user); static boolean checkAuthorization(Securable securable, Action action,
      Authority authority); static boolean checkAuthorizationForSome(Securable securable,
      Set<Action> actions, Authority authorization); static boolean checkAuthorizationForAll(Securable securable,
      Set<Action> actions, Authority authorization);  }
@Test public final void testCheckOneOf() { Set<Action> actions = new HashSet<Action>(); actions.add(WRITE); actions.add(PUBLISH); SecurityContextImpl context = SecurityContextImpl.fromXml(allowConfig, path); if (!SecurityUtils.checkAuthorizationForSome(context, actions, EDITOR)) { fail(EDITOR + " was expected to pass but failed"); } if (SecurityUtils.checkAuthorizationForSome(context, actions, GUEST)) { fail(GUEST + " was not expected to pass"); } }