/** * Returns the list of system defined roles (instances of <code>{@link CmsRole}</code>).<p> * * Caution: This list can not be modified.<p> * * @return the list of system defined roles */ public static List getSystemRoles() { return CmsRole.getSystemRoles(); }
/** * Returns the list of system defined roles (instances of <code>{@link CmsRole}</code>).<p> * * Caution: This list can not be modified.<p> * * @return the list of system defined roles */ public static List<CmsRole> getSystemRoles() { return CmsRole.getSystemRoles(); }
/** * Returns the flags needed for a group to emulate this role.<p> * * @return the flags needed for a group to emulate this role */ public int getVirtualGroupFlags() { int flags = I_CmsPrincipal.FLAG_GROUP_VIRTUAL; flags += I_CmsPrincipal.FLAG_GROUP_VIRTUAL * 2 * getSystemRoles().indexOf(forOrgUnit(null)); return flags; }
/** * Returns the flags needed for a group to emulate this role.<p> * * @return the flags needed for a group to emulate this role */ public int getVirtualGroupFlags() { int flags = I_CmsPrincipal.FLAG_GROUP_VIRTUAL; flags += I_CmsPrincipal.FLAG_GROUP_VIRTUAL * 2 * getSystemRoles().indexOf(forOrgUnit(null)); return flags; }
/** * Applies the system role order to a list of roles.<p> * * @param roles the roles */ public static void applySystemRoleOrder(List<CmsRole> roles) { Map<String, CmsRole> ouRoles = new HashMap<String, CmsRole>(); for (CmsRole role : roles) { ouRoles.put(role.getRoleName(), role); } roles.clear(); for (CmsRole sysRole : CmsRole.getSystemRoles()) { if (ouRoles.containsKey(sysRole.getRoleName())) { roles.add(ouRoles.get(sysRole.getRoleName())); } } }
/** * 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; }
/** * 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; }
if (role == null) { Iterator<CmsRole> it = CmsRole.getSystemRoles().iterator(); while (it.hasNext()) { role = it.next();
if (role == null) { Iterator<CmsRole> it = CmsRole.getSystemRoles().iterator(); while (it.hasNext()) { role = it.next();
if (role == null) { Iterator it = CmsRole.getSystemRoles().iterator(); while (it.hasNext()) { role = (CmsRole)it.next();
|| ((CmsOrganizationalUnit.getParentFqn(ouFqn) == null) && !existsGroup(dbc, rootAdminRole))) { Iterator<CmsRole> itRoles = CmsRole.getSystemRoles().iterator(); while (itRoles.hasNext()) { CmsRole role = itRoles.next();
boolean isRootOu = CmsOrganizationalUnit.getParentFqn(ouFqn) == null; try { for (CmsRole role : CmsRole.getSystemRoles()) { if (webuser && (role != CmsRole.ACCOUNT_MANAGER)) {
|| ((CmsOrganizationalUnit.getParentFqn(ouFqn) == null) && !existsGroup(dbc, rootAdminRole))) { Iterator itRoles = CmsRole.getSystemRoles().iterator(); while (itRoles.hasNext()) { CmsRole role = (CmsRole)itRoles.next();