jaxrs/src/main/java/de/taimos/dvalin/jaxrs/providers/AuthorizationProvider.java
/**
     * Create a {@link SecurityContext} to return to the provider
     *
     * @param user  the user principal
     * @param roles the roles of the user
     * @return the {@link SecurityContext}
     */
Create a  SecurityContext to return to the provider
@param user  the user principal
@param roles the roles of the user
@return the  SecurityContext
Create a SecurityContext to return to the provider @param user the user principal @param roles the roles of the user @return the SecurityContext
protected static SecurityContext createSC(String user, String... roles) {
        final Subject subject = new Subject();
        final Principal principal = new SimplePrincipal(user);
        subject.getPrincipals().add(principal);
        if (roles != null) {
            for (final String role : roles) {
                subject.getPrincipals().add(new SimplePrincipal(role));
            }
        }
        return new DefaultSecurityContext(principal, subject);
    }
protected static SecurityContext createSC ( String user , String ... roles ) { final Subject subject = new Subject ( ) ; final Principal principal = new SimplePrincipal ( user ) ; subject . getPrincipals ( ) . add ( principal ) ; if ( roles != null ) { for ( final String role : roles ) { subject . getPrincipals ( ) . add ( new SimplePrincipal ( role ) ) ; } } return new DefaultSecurityContext ( principal , subject ) ; }
Create a {@link SecurityContext} to return to the provider
 @param user  the user principal
 @param roles the roles of the user
 @return the {@link SecurityContext}
Create a { @link SecurityContext } to return to the provider @param user the user principal @param roles the roles of the user @return the { @link SecurityContext }