if ((group == null) || (!group.isRole())) { throw new CmsDbEntryNotFoundException( Messages.get().container(Messages.ERR_UNKNOWN_GROUP_1, roleGroupName));
/** * Returns the role for the given group.<p> * * @param group a group to check for role representation * * @return the role for the given group */ public static CmsRole valueOf(CmsGroup group) { // check groups for internal representing the roles if (group.isRole()) { CmsRole role = valueOfGroupName(group.getName()); if (role != null) { return role; } } // check virtual groups mapping a role if (group.isVirtual()) { int index = (group.getFlags() & (I_CmsPrincipal.FLAG_CORE_LIMIT - 1)); index = index / (I_CmsPrincipal.FLAG_GROUP_VIRTUAL * 2); CmsRole role = getSystemRoles().get(index); return role.forOrgUnit(group.getOuFqn()); } return null; }
/** * Returns the role for the given group.<p> * * @param group a group to check for role representation * * @return the role for the given group */ public static CmsRole valueOf(CmsGroup group) { // check groups for internal representing the roles if (group.isRole()) { CmsRole role = valueOfGroupName(group.getName()); if (role != null) { return role; } } // check virtual groups mapping a role if (group.isVirtual()) { int index = (group.getFlags() & (I_CmsPrincipal.FLAG_CORE_LIMIT - 1)); index = index / (I_CmsPrincipal.FLAG_GROUP_VIRTUAL * 2); CmsRole role = (CmsRole)getSystemRoles().get(index); return role.forOrgUnit(group.getOuFqn()); } return null; }
List users = getUsersOfGroup(dbc, group.getName(), true, true, group.isRole()); while (itUsers.hasNext()) { CmsUser user = (CmsUser)itUsers.next(); if (userInGroup(dbc, user.getName(), group.getName(), group.isRole())) { removeUserFromGroup(dbc, user.getName(), group.getName(), group.isRole()); while (itUsers.hasNext()) { CmsUser user = (CmsUser)itUsers.next(); addUserToGroup(dbc, user.getName(), replacementGroup.getName(), group.isRole()); removeUserFromGroup(dbc, user.getName(), group.getName(), group.isRole());
List<CmsUser> users = getUsersOfGroup(dbc, group.getName(), true, true, group.isRole()); while (itUsers.hasNext()) { CmsUser user = itUsers.next(); if (userInGroup(dbc, user.getName(), group.getName(), group.isRole())) { removeUserFromGroup(dbc, user.getName(), group.getName(), group.isRole()); while (itUsers.hasNext()) { CmsUser user = itUsers.next(); addUserToGroup(dbc, user.getName(), replacementGroup.getName(), group.isRole()); removeUserFromGroup(dbc, user.getName(), group.getName(), group.isRole());
if (!parentGroup.isRole() && !CmsOrganizationalUnit.getParentFqn(parent).equals(CmsOrganizationalUnit.getParentFqn(name))) { throw new CmsDataAccessException(Messages.get().container(
if (!parentGroup.isRole() && !CmsOrganizationalUnit.getParentFqn(parent).equals(CmsOrganizationalUnit.getParentFqn(name))) { throw new CmsDataAccessException(
try { CmsGroup group = m_cms.readGroup(groupName); if (group.isVirtual() || group.isRole()) { CmsRole role = CmsRole.valueOf(group); OpenCms.getRoleManager().addUserToRole(m_cms, role, name);
try { CmsGroup group = m_cms.readGroup(groupName); if (group.isVirtual() || group.isRole()) { CmsRole role = CmsRole.valueOf(group); OpenCms.getRoleManager().addUserToRole(m_cms, role, name);
if (group.isRole()) { throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, name));
if (group.isRole()) { throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, name));
if (group.isRole()) { throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, group.getName()));
if (group.isRole()) { throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, group.getName()));