Package org.jboss.security

Examples of org.jboss.security.SimpleGroup.addMember()


    }

    @Override
    protected Group[] getRoleSets() throws LoginException {
        Group roles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
        roles.addMember(new SimplePrincipal(role));
        return new Group[] { roles };
    }

    @Override
    protected Principal getIdentity() {
View Full Code Here


     */
    @Override
    protected Group[] getRoleSets() throws LoginException {
        try {
            Group roles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
            roles.addMember(new SimplePrincipal(role));
            Group callerPrincipal = new SimpleGroup(SecurityConstants.CALLER_PRINCIPAL_GROUP);
            callerPrincipal.addMember(new CustomPrincipal(CALLER_NAME));
            return new Group[] { roles, callerPrincipal };
        } catch (Exception e) {
            throw new LoginException(e.toString());
View Full Code Here

    protected Group[] getRoleSets() throws LoginException {
        try {
            Group roles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
            roles.addMember(new SimplePrincipal(role));
            Group callerPrincipal = new SimpleGroup(SecurityConstants.CALLER_PRINCIPAL_GROUP);
            callerPrincipal.addMember(new CustomPrincipal(CALLER_NAME));
            return new Group[] { roles, callerPrincipal };
        } catch (Exception e) {
            throw new LoginException(e.toString());
        }
    }
View Full Code Here

    @Override
    protected Group[] getRoleSets() throws LoginException {
        Group roles = new SimpleGroup("Roles");
        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        Group[] groups = { roles, callerPrincipal };
        callerPrincipal.addMember(getIdentity());
        return groups;
    }

}
View Full Code Here

    @Override
    protected Group[] getRoleSets() throws LoginException {
        Group roles = new SimpleGroup("Roles");
        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        Group[] groups = { roles, callerPrincipal };
        callerPrincipal.addMember(getIdentity());
        return groups;
    }

}
View Full Code Here

            SimpleGroup sg = new SimpleGroup("Roles");

            Set<RealmRole> roles = sui.getSubject().getPrincipals(RealmRole.class);
            for (RealmRole current : roles) {
                sg.addMember(createIdentity(current.getName()));
            }

            return new Group[]{sg};
        } catch (Exception e) {
            throw SecurityLogger.ROOT_LOGGER.failureCallingSecurityRealm(e.getMessage());
View Full Code Here


    public boolean commit() throws LoginException {
        Set<Principal> principals = subject.getPrincipals();
        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        callerPrincipal.addMember(new SimplePrincipal(username));
        principals.add(callerPrincipal);
        Group roles = new SimpleGroup("Roles");
        if (username.equals("anil"))
            roles.addMember(new SimplePrincipal("gooduser"));
        if (username.equals("marcus"))
View Full Code Here

        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        callerPrincipal.addMember(new SimplePrincipal(username));
        principals.add(callerPrincipal);
        Group roles = new SimpleGroup("Roles");
        if (username.equals("anil"))
            roles.addMember(new SimplePrincipal("gooduser"));
        if (username.equals("marcus"))
            roles.addMember(new SimplePrincipal("superuser"));
        principals.add(roles);
        return true;
    }
View Full Code Here

        principals.add(callerPrincipal);
        Group roles = new SimpleGroup("Roles");
        if (username.equals("anil"))
            roles.addMember(new SimplePrincipal("gooduser"));
        if (username.equals("marcus"))
            roles.addMember(new SimplePrincipal("superuser"));
        principals.add(roles);
        return true;
    }

View Full Code Here

    @Override
    public boolean commit() throws LoginException {
        Set<Principal> principals = subject.getPrincipals();
        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        callerPrincipal.addMember(new SimplePrincipal(username));
        principals.add(callerPrincipal);
        Group roles = new SimpleGroup("Roles");
        if (username.equals("anil"))
            roles.addMember(new SimplePrincipal("gooduser"));
        if (username.equals("marcus"))
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.