List of usage examples for java.security.acl Group removeMember
public boolean removeMember(Principal user);
From source file:org.betaconceptframework.astroboa.context.SecurityContext.java
public boolean removeRole(String role) { if (StringUtils.isBlank(role)) { return false; }/* w ww.j a v a 2s.com*/ boolean roleHasBeenRemoved = false; Set<Group> groups = subject.getPrincipals(Group.class); if (groups != null) { String nameOfGroupWhichContainsTheRoles = AstroboaPrincipalName.Roles.toString(); for (Group group : groups) { if (StringUtils.equals(nameOfGroupWhichContainsTheRoles, group.getName())) { final CmsPrincipal rolePrincipal = new CmsPrincipal(role); if (group.isMember(rolePrincipal)) { roleHasBeenRemoved = group.removeMember(rolePrincipal); break; } } } } //remove role from the list as well if (roleHasBeenRemoved && this.roles.contains(role)) { this.roles.remove(role); } return roleHasBeenRemoved; }