/** * Remove this method when data-access is JCR-branched * * @param ignoredSession * @param ignoredAllowAnonymous * @return */ @Override public Authentication getAuthentication( IPentahoSession ignoredSession, boolean ignoredAllowAnonymous ) { return getAuthentication(); }
/** * Utility method that communicates with the installed ACLVoter to determine whether a particular role is granted to * the specified user. * * @param session The users' IPentahoSession * @param role The role to look for * @return true if the user is granted the specified role. */ @Override public boolean isGranted( final IPentahoSession session, final GrantedAuthority role ) { Authentication auth = getAuthentication(); if ( ( auth != null ) && auth.isAuthenticated() ) { Collection<? extends GrantedAuthority> userAuths = auth.getAuthorities(); if ( userAuths == null ) { return false; } for ( GrantedAuthority element : userAuths ) { if ( element.equals( role ) ) { return true; } } return false; } else { return false; } }