/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, List)} call returns <code>true</code>, * <code>false</code> otherwise. */ public boolean[] isPermitted(PrincipalCollection principals, List<Permission> permissions) { assertRealmsConfigured(); if (permissions != null && !permissions.isEmpty()) { boolean[] isPermitted = new boolean[permissions.size()]; int i = 0; for (Permission p : permissions) { isPermitted[i++] = isPermitted(principals, p); } return isPermitted; } return new boolean[0]; }
/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, Permission)} call returns <code>true</code> * for <em>all</em> of the specified Permissions, <code>false</code> otherwise. */ public boolean isPermittedAll(PrincipalCollection principals, Collection<Permission> permissions) { assertRealmsConfigured(); if (permissions != null && !permissions.isEmpty()) { for (Permission permission : permissions) { if (!isPermitted(principals, permission)) { return false; } } } return true; }
/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, String)} call returns <code>true</code> * for <em>all</em> of the specified string permissions, <code>false</code> otherwise. */ public boolean isPermittedAll(PrincipalCollection principals, String... permissions) { assertRealmsConfigured(); if (permissions != null && permissions.length > 0) { for (String perm : permissions) { if (!isPermitted(principals, perm)) { return false; } } } return true; }
/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermittedAll(org.apache.shiro.subject.PrincipalCollection, String...)} call returns * <code>true</code>, <code>false</code> otherwise. */ public boolean[] isPermitted(PrincipalCollection principals, String... permissions) { assertRealmsConfigured(); if (permissions != null && permissions.length > 0) { boolean[] isPermitted = new boolean[permissions.length]; for (int i = 0; i < permissions.length; i++) { isPermitted[i] = isPermitted(principals, permissions[i]); } return isPermitted; } return new boolean[0]; }
/** * If !{@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, String) isPermitted(permission)}, throws * an <code>UnauthorizedException</code> otherwise returns quietly. */ public void checkPermission(PrincipalCollection principals, String permission) throws AuthorizationException { assertRealmsConfigured(); if (!isPermitted(principals, permission)) { throw new UnauthorizedException("Subject does not have permission [" + permission + "]"); } }
/** * If !{@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, Permission) isPermitted(permission)}, throws * an <code>UnauthorizedException</code> otherwise returns quietly. */ public void checkPermission(PrincipalCollection principals, Permission permission) throws AuthorizationException { assertRealmsConfigured(); if (!isPermitted(principals, permission)) { throw new UnauthorizedException("Subject does not have permission [" + permission + "]"); } }
/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermittedAll(org.apache.shiro.subject.PrincipalCollection, String...)} call returns * <code>true</code>, <code>false</code> otherwise. */ public boolean[] isPermitted(PrincipalCollection principals, String... permissions) { assertRealmsConfigured(); if (permissions != null && permissions.length > 0) { boolean[] isPermitted = new boolean[permissions.length]; for (int i = 0; i < permissions.length; i++) { isPermitted[i] = isPermitted(principals, permissions[i]); } return isPermitted; } return new boolean[0]; }
/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, String)} call returns <code>true</code> * for <em>all</em> of the specified string permissions, <code>false</code> otherwise. */ public boolean isPermittedAll(PrincipalCollection principals, String... permissions) { assertRealmsConfigured(); if (permissions != null && permissions.length > 0) { for (String perm : permissions) { if (!isPermitted(principals, perm)) { return false; } } } return true; }
/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, Permission)} call returns <code>true</code> * for <em>all</em> of the specified Permissions, <code>false</code> otherwise. */ public boolean isPermittedAll(PrincipalCollection principals, Collection<Permission> permissions) { assertRealmsConfigured(); if (permissions != null && !permissions.isEmpty()) { for (Permission permission : permissions) { if (!isPermitted(principals, permission)) { return false; } } } return true; }
/** * Returns <code>true</code> if any of the configured realms' * {@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, List)} call returns <code>true</code>, * <code>false</code> otherwise. */ public boolean[] isPermitted(PrincipalCollection principals, List<Permission> permissions) { assertRealmsConfigured(); if (permissions != null && !permissions.isEmpty()) { boolean[] isPermitted = new boolean[permissions.size()]; int i = 0; for (Permission p : permissions) { isPermitted[i++] = isPermitted(principals, p); } return isPermitted; } return new boolean[0]; }
/** * If !{@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, String) isPermitted(permission)}, throws * an <code>UnauthorizedException</code> otherwise returns quietly. */ public void checkPermission(PrincipalCollection principals, String permission) throws AuthorizationException { assertRealmsConfigured(); if (!isPermitted(principals, permission)) { throw new UnauthorizedException("Subject does not have permission [" + permission + "]"); } }
/** * If !{@link #isPermitted(org.apache.shiro.subject.PrincipalCollection, Permission) isPermitted(permission)}, throws * an <code>UnauthorizedException</code> otherwise returns quietly. */ public void checkPermission(PrincipalCollection principals, Permission permission) throws AuthorizationException { assertRealmsConfigured(); if (!isPermitted(principals, permission)) { throw new UnauthorizedException("Subject does not have permission [" + permission + "]"); } }
/** * Returns <code>true</code> if any of the configured realms' * {@link Realm#isPermitted(org.apache.shiro.subject.PrincipalCollection , Permission)} call returns <code>true</code> * for <em>all</em> of the specified Permissions, <code>false</code> otherwise. */ public boolean isPermittedAll(PrincipalCollection principals, Collection<Permission> permissions) { assertRealmsConfigured(); if (permissions != null && !permissions.isEmpty()) { for (Permission permission : permissions) { if (!isPermitted(principals, permission)) { return false; } } } return true; }
/** * Returns <code>true</code> if any of the configured realms' * {@link Realm#isPermittedAll(org.apache.shiro.subject.PrincipalCollection, String...)} call returns * <code>true</code>, <code>false</code> otherwise. */ public boolean[] isPermitted(PrincipalCollection principals, String... permissions) { assertRealmsConfigured(); if (permissions != null && permissions.length > 0) { boolean[] isPermitted = new boolean[permissions.length]; for (int i = 0; i < permissions.length; i++) { isPermitted[i] = isPermitted(principals, permissions[i]); } return isPermitted; } return new boolean[0]; }
/** * Returns <code>true</code> if any of the configured realms' * {@link Realm#isPermitted(org.apache.shiro.subject.PrincipalCollection , String)} call returns <code>true</code> * for <em>all</em> of the specified string permissions, <code>false</code> otherwise. */ public boolean isPermittedAll(PrincipalCollection principals, String... permissions) { assertRealmsConfigured(); if (permissions != null && permissions.length > 0) { for (String perm : permissions) { if (!isPermitted(principals, perm)) { return false; } } } return true; }
/** * Returns <code>true</code> if any of the configured realms' * {@link org.apache.shiro.realm.Realm#isPermitted(org.apache.shiro.subject.PrincipalCollection , List)} call returns <code>true</code>, * <code>false</code> otherwise. */ public boolean[] isPermitted(PrincipalCollection principals, List<Permission> permissions) { assertRealmsConfigured(); if (permissions != null && !permissions.isEmpty()) { boolean[] isPermitted = new boolean[permissions.size()]; int i = 0; for (Permission p : permissions) { isPermitted[i++] = isPermitted(principals, p); } return isPermitted; } return new boolean[0]; }
/** * If !{@link #isPermitted(org.apache.shiro.subject.PrincipalCollection , Permission) isPermitted(permission)}, throws * an <code>UnauthorizedException</code> otherwise returns quietly. */ public void checkPermission(PrincipalCollection principals, Permission permission) throws AuthorizationException { assertRealmsConfigured(); if (!isPermitted(principals, permission)) { throw new UnauthorizedException("Subject does not have permission [" + permission + "]"); } }
/** * If !{@link #isPermitted(org.apache.shiro.subject.PrincipalCollection , String) isPermitted(permission)}, throws * an <code>UnauthorizedException</code> otherwise returns quietly. */ public void checkPermission(PrincipalCollection principals, String permission) throws AuthorizationException { assertRealmsConfigured(); if (!isPermitted(principals, permission)) { throw new UnauthorizedException("Subject does not have permission [" + permission + "]"); } }