public boolean hasRole(PrincipalCollection principals, String roleIdentifier) { return this.authorizer.hasRole(principals, roleIdentifier); }
/** * Returns <code>true</code> if any of the configured realms' * {@link #hasRole(org.apache.shiro.subject.PrincipalCollection, String)} call returns <code>true</code>, * <code>false</code> otherwise. */ public boolean hasRole(PrincipalCollection principals, String roleIdentifier) { assertRealmsConfigured(); for (Realm realm : getRealms()) { if (!(realm instanceof Authorizer)) continue; if (((Authorizer) realm).hasRole(principals, roleIdentifier)) { return true; } } return false; }
public boolean hasRole(PrincipalCollection principals, String roleIdentifier) { return this.authorizer.hasRole(principals, roleIdentifier); }
/** * Returns <code>true</code> if any of the configured realms' * {@link #hasRole(org.apache.shiro.subject.PrincipalCollection, String)} call returns <code>true</code>, * <code>false</code> otherwise. */ public boolean hasRole(PrincipalCollection principals, String roleIdentifier) { assertRealmsConfigured(); for (Realm realm : getRealms()) { if (!(realm instanceof Authorizer)) continue; if (((Authorizer) realm).hasRole(principals, roleIdentifier)) { return true; } } return false; }
public boolean hasRole(PrincipalCollection principals, String roleIdentifier) { return this.authorizer.hasRole(principals, roleIdentifier); }
public boolean hasRole(PrincipalCollection principals, String roleIdentifier) { assertRealmsConfigured(); for (Realm realm : getRealms()) { if (!(realm instanceof Authorizer) || principals.fromRealm(realm.getName()).isEmpty()) continue; if (((Authorizer) realm).hasRole(principals, roleIdentifier)) return true; } return false; }
@Override public boolean hasRole(PrincipalCollection subjectPrincipal, String roleIdentifier) { for (Realm realm : getRealms()) { if (!(realm instanceof Authorizer)) { continue; // ignore non-authorizing realms } // need to catch an AuthorizationException, the user might only belong to on of the realms try { if (((Authorizer) realm).hasRole(subjectPrincipal, roleIdentifier)) { return true; } } catch (AuthorizationException e) { logAndIgnore(realm, e); } catch (RuntimeException e) { logAndIgnore(realm, e); } } return false; }
@Override public boolean hasRole( PrincipalCollection subjectPrincipal, String roleIdentifier ) { for ( Realm realm : this.getRealms() ) { if ( !( realm instanceof Authorizer ) ) { continue; // ignore non-authorizing realms } // need to catch an AuthorizationException, the user might only belong to on of the realms try { if ( ( (Authorizer) realm ).hasRole( subjectPrincipal, roleIdentifier ) ) { return true; } } catch ( AuthorizationException e ) { logAndIgnore( realm, e ); } catch ( RuntimeException e ) { logAndIgnore( realm, e ); } } return false; }