/** * Removes a given role as (required)member from any groups it is member of. * * @param removedRole the role that is removed from the store already, cannot be <code>null</code> * . * @throws BackendException in case of problems accessing the store. */ private void removeRoleFromAllGroups(Role removedRole) { try { Role[] roles = m_store.getRoles(null); for (int i = 0; i < roles.length; i++) { if (roles[i].getType() == Role.GROUP) { Group group = (Group) roles[i]; // Don't check whether the given role is actually a member // of the group, but let the group itself figure this out... group.removeMember(removedRole); } } } catch (Exception e) { throw new BackendException("Failed to get all roles!", e); } }