@Override public Authentication getAuthentication( final IPentahoSession session ) { return SecurityHelper.getInstance().getAuthentication(); }
@Override public Authentication getAuthentication( final IPentahoSession session ) { return SecurityHelper.getInstance().getAuthentication( session, true ); }
@Override public Authentication getAuthentication( final IPentahoSession session ) { return SecurityHelper.getInstance().getAuthentication(); }
private Authentication getAuthentication() { return SecurityHelper.getInstance().getAuthentication(); }
protected List<String> getRuntimeRoleNames() { IPentahoSession pentahoSession = PentahoSessionHolder.getSession(); List<String> runtimeRoles = new ArrayList<String>(); Assert.state( pentahoSession != null ); Authentication authentication = SecurityHelper.getInstance().getAuthentication(); if ( authentication != null ) { Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities(); for ( GrantedAuthority auth : authorities ) { runtimeRoles.add( auth.getAuthority() ); } } return runtimeRoles; }
/** * @return */ protected String getCurrentUser() { IPentahoSession session = PentahoSessionHolder.getSession(); if ( session == null ) { return null; } Principal p = SecurityHelper.getInstance().getAuthentication(); return ( p == null ) ? null : p.getName(); }
public List<String> getPermittedRoleList( IPentahoSession session ) { List<String> roleList = new ArrayList<String>(); Authentication auth = SecurityHelper.getInstance().getAuthentication( session, true ); IPluginResourceLoader resLoader = PentahoSystem.get( IPluginResourceLoader.class, null ); String roles = null; try { roles = resLoader.getPluginSetting( getClass(), "settings/data-access-view-roles" ); //$NON-NLS-1$ } catch ( Exception e ) { logger.debug( "Error getting plugin setting", e ); } if ( roles != null && roles.length() > 0 ) { String[] roleArr = roles.split( "," ); //$NON-NLS-1$ for ( String role : roleArr ) { if ( role != null && role.trim().length() > 0 ) { roleList.add( role ); } } } return roleList; }
Authentication auth = SecurityHelper.getInstance().getAuthentication( session, true );