public boolean hasRole()

in impl/src/main/java/org/apache/directory/fortress/realm/tomcat/TcAccessMgrImpl.java [110:132]


    public boolean hasRole( Principal principal, String roleName )
    {
        boolean result = false;
        String userId = principal.getName();
        try
        {
            if ( j2eeMgr.hasRole( principal, roleName ) )
            {
                LOG.debug( "{}.hasRole userId [{}], role[{}], successful", CLS_NM, principal.getName(), roleName );
                result = true;
            }
            else
            {
                LOG.debug( "{}.hasRole userId [{}], role[{}], failed", CLS_NM, principal.getName(), roleName );
            }
        }
        catch ( SecurityException se )
        {
            LOG.warn( "{}.hasRole userId <{}> role <{}> caught SecurityException= {}", CLS_NM, userId, roleName, se);
        }

        return result;
    }