Java Code Examples for org.apache.catalina.Group#removeRole()
The following examples show how to use
org.apache.catalina.Group#removeRole() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MemoryUserDatabase.java From Tomcat8-Source-Read with MIT License | 6 votes |
/** * Remove the specified {@link Role} from this user database. * * @param role The role to be removed */ @Override public void removeRole(Role role) { readLock.lock(); try { Iterator<Group> groups = getGroups(); while (groups.hasNext()) { Group group = groups.next(); group.removeRole(role); } Iterator<User> users = getUsers(); while (users.hasNext()) { User user = users.next(); user.removeRole(role); } roles.remove(role.getRolename()); } finally { readLock.unlock(); } }
Example 2
Source File: MemoryUserDatabase.java From Tomcat7.0.67 with Apache License 2.0 | 6 votes |
/** * Remove the specified {@link Role} from this user database. * * @param role The role to be removed */ @Override public void removeRole(Role role) { synchronized (roles) { Iterator<Group> groups = getGroups(); while (groups.hasNext()) { Group group = groups.next(); group.removeRole(role); } Iterator<User> users = getUsers(); while (users.hasNext()) { User user = users.next(); user.removeRole(role); } roles.remove(role.getRolename()); } }
Example 3
Source File: MemoryUserDatabase.java From tomcatsrc with Apache License 2.0 | 6 votes |
/** * Remove the specified {@link Role} from this user database. * * @param role The role to be removed */ @Override public void removeRole(Role role) { synchronized (roles) { Iterator<Group> groups = getGroups(); while (groups.hasNext()) { Group group = groups.next(); group.removeRole(role); } Iterator<User> users = getUsers(); while (users.hasNext()) { User user = users.next(); user.removeRole(role); } roles.remove(role.getRolename()); } }
Example 4
Source File: GroupMBean.java From Tomcat8-Source-Read with MIT License | 5 votes |
/** * Remove a {@link Role} from those this group belongs to. * * @param rolename Role name of the old role */ public void removeRole(String rolename) { Group group = (Group) this.resource; if (group == null) { return; } Role role = group.getUserDatabase().findRole(rolename); if (role == null) { throw new IllegalArgumentException("Invalid role name [" + rolename + "]"); } group.removeRole(role); }
Example 5
Source File: GroupMBean.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
/** * Remove a {@link Role} from those this group belongs to. * * @param rolename Role name of the old role */ public void removeRole(String rolename) { Group group = (Group) this.resource; if (group == null) { return; } Role role = group.getUserDatabase().findRole(rolename); if (role == null) { throw new IllegalArgumentException ("Invalid role name '" + rolename + "'"); } group.removeRole(role); }
Example 6
Source File: GroupMBean.java From tomcatsrc with Apache License 2.0 | 5 votes |
/** * Remove a {@link Role} from those this group belongs to. * * @param rolename Role name of the old role */ public void removeRole(String rolename) { Group group = (Group) this.resource; if (group == null) { return; } Role role = group.getUserDatabase().findRole(rolename); if (role == null) { throw new IllegalArgumentException ("Invalid role name '" + rolename + "'"); } group.removeRole(role); }