public boolean isUserInRole(String role) { return ((GenericPrincipal)principal).hasRole(role); }
public boolean isUserInRole(String role) { return ((GenericPrincipal)principal).hasRole(role); }
/** * Check if the specified Principal has the specified * security role, within the context of this Realm. * * This method or {@link #hasRoleInternal(Principal, * String)} can be overridden by Realm implementations, but the default is * adequate when an instance of <code>GenericPrincipal</code> is used to * represent authenticated Principals from this Realm. * * @param principal Principal for whom the role is to be checked * @param role Security role to be checked * * @return <code>true</code> if the specified Principal has the specified * security role, within the context of this Realm; otherwise return * <code>false</code>. */ protected boolean hasRoleInternal(Principal principal, String role) { // Should be overridden in JAASRealm - to avoid pretty inefficient conversions if (!(principal instanceof GenericPrincipal)) { return false; } GenericPrincipal gp = (GenericPrincipal) principal; return gp.hasRole(role); }
/** * Check if the specified Principal has the specified * security role, within the context of this Realm. * * This method or {@link #hasRoleInternal(Principal, * String)} can be overridden by Realm implementations, but the default is * adequate when an instance of <code>GenericPrincipal</code> is used to * represent authenticated Principals from this Realm. * * @param principal Principal for whom the role is to be checked * @param role Security role to be checked * * @return <code>true</code> if the specified Principal has the specified * security role, within the context of this Realm; otherwise return * <code>false</code>. */ protected boolean hasRoleInternal(Principal principal, String role) { // Should be overridden in JAASRealm - to avoid pretty inefficient conversions if (!(principal instanceof GenericPrincipal)) { return false; } GenericPrincipal gp = (GenericPrincipal) principal; return gp.hasRole(role); }
boolean result = gp.hasRole(role); if (log.isLoggable(Level.FINE)) { String name = principal.getName();
log.debug("Different realm " + this + " " + gp.getRealm());// return (false); boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
@Override public boolean hasRole(final Wrapper wrapper, final Principal principal, final String rawRole) { String role = rawRole; // Check for a role alias defined in a <security-role-ref> element if (wrapper != null) { final String realRole = wrapper.findSecurityReference(role); if (realRole != null) { role = realRole; } } if (principal == null || role == null) { return false; } if (principal instanceof GenericPrincipal) { return ((GenericPrincipal) principal).hasRole(role); } for (final Realm realm : realms) { // when used implicitely (always?) realms.size == 1 so no need of a strategy if (realm.hasRole(wrapper, principal, rawRole)) { return true; } } return false; }
log.debug("Different realm " + this + " " + gp.getRealm());// return (false); boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
boolean result = gp.hasRole(role); if (log.isDebugEnabled()) { String name = principal.getName();
CatalinaLogger.REALM_LOGGER.debug("Different realm " + this + " " + gp.getRealm());// return (false); boolean result = gp.hasRole(role); if (CatalinaLogger.REALM_LOGGER.isDebugEnabled()) { String name = principal.getName();
if (!gp.hasRole(skeletonKeyConfig.getAdminRole()))
if (!gp.hasRole(remoteSkeletonKeyConfig.getAdminRole()))