Checks if the given group name is a valid opencms user group.<p>

@param groupName the group name to check

@return the read group
556433
private CmsGroup checkGroup(String groupName) {

        try {
            return getCms().readGroup(groupName);
        } catch (CmsException e) {
            throw new CmsIllegalArgumentException(e.getMessageContainer());
        }
    }
93535
protected CmsPrincipalSelect getGroupSelect(String ou, boolean enabled, CmsUUID groupID) {

        CmsPrincipalSelect select = new CmsPrincipalSelect();
        select.setOU(ou);
        select.setEnabled(enabled);
        select.setRealPrincipalsOnly(true);
        select.setPrincipalType(I_CmsPrincipal.PRINCIPAL_GROUP);
        select.setWidgetType(WidgetType.groupwidget);

        if (groupID != null) {
            try {
                select.setValue(m_cms.readGroup(groupID).getName());
            } catch (CmsException e) {
                LOG.error("Unable to read group", e);
            }
        }

        //OU Change enabled because ou-user can be part of other ou-groups
        return select;
    }
1152130
private I_CmsGroupNameTranslation getDefaultGroupNameTranslation() {

        return new I_CmsGroupNameTranslation() {

            public String translateGroupName(String group, boolean keepOu) {

                return keepOu ? group : CmsOrganizationalUnit.getSimpleName(group);
            }
        };
    }
1372178
public boolean belongsTo(String groupname) {
        if (groupname == null) {
            return false;
        }
        for (PMSecurityUserGroup g : getGroups()) {
            if (groupname.equalsIgnoreCase(g.getName())) {
                return true;
            }
        }
        return false;
    }
519475
public static systemgroup_systemcmdpolicy_binding[] get(nitro_service service, String groupname) throws Exception{
		systemgroup_systemcmdpolicy_binding obj = new systemgroup_systemcmdpolicy_binding();
		obj.set_groupname(groupname);
		systemgroup_systemcmdpolicy_binding response[] = (systemgroup_systemcmdpolicy_binding[]) obj.get_resources(service);
		return response;
	}
1023431
public Response addUserToGroup(String username, String groupName) {
		return restClient.post("users/" + username + "/groups/"+ groupName, null,
				new HashMap<String, String>());
	}
1229626
public Group getGroupByName(String name) {
        List<Group> groups = getGroupsByName(name, true);

        if (!groups.isEmpty()) {
            return groups.get(0);
        }

        return null;
    }
368454
public Response deleteUserFromGroup(String username, String groupName) {
		return restClient.delete("users/" + username + "/groups/" + groupName,
				new HashMap<String, String>());
	}
1291907
public CmsLocaleGroup readLocaleGroup(CmsResource resource) throws CmsException {

        if (resource.isFolder()) {
            CmsResource defaultFile = m_cms.readDefaultFile(resource, CmsResourceFilter.IGNORE_EXPIRATION);
            if (defaultFile != null) {
                resource = defaultFile;
            }
        }

        List<CmsRelation> relations = m_cms.readRelations(
            CmsRelationFilter.ALL.filterType(CmsRelationType.LOCALE_VARIANT).filterStructureId(
                resource.getStructureId()));
        List<CmsRelation> out = Lists.newArrayList();
        List<CmsRelation> in = Lists.newArrayList();
        for (CmsRelation rel : relations) {
            if (rel.getSourceId().equals(resource.getStructureId())) {
                out.add(rel);
            } else {
                in.add(rel);
            }
        }
        CmsResource primaryResource = null;
        List<CmsResource> secondaryResources = Lists.newArrayList();
        if ((out.size() == 0) && (in.size() == 0)) {
            primaryResource = resource;
        } else if ((out.size() == 0) && (in.size() > 0)) {
            primaryResource = resource;
            // resource is the primary variant
            for (CmsRelation relation : in) {
                CmsResource source = relation.getSource(m_cms, CmsResourceFilter.ALL);
                secondaryResources.add(source);
            }
        } else if ((out.size() == 1) && (in.size() == 0)) {

            CmsResource target = out.get(0).getTarget(m_cms, CmsResourceFilter.ALL);
            primaryResource = target;
            CmsRelationFilter filter = CmsRelationFilter.TARGETS.filterType(
                CmsRelationType.LOCALE_VARIANT).filterStructureId(target.getStructureId());
            List<CmsRelation> relationsToTarget = m_cms.readRelations(filter);
            for (CmsRelation targetRelation : relationsToTarget) {
                CmsResource secondaryResource = targetRelation.getSource(m_cms, CmsResourceFilter.ALL);
                secondaryResources.add(secondaryResource);
            }
        } else {
            throw new IllegalStateException(
                "illegal locale variant relations for resource with id="
                    + resource.getStructureId()
                    + ", path="
                    + resource.getRootPath());
        }
        return new CmsLocaleGroup(m_cms, primaryResource, secondaryResources);
    }
977403
public static boolean isModelGroupResource(CmsResource resource) {

        return CmsResourceTypeXmlContainerPage.MODEL_GROUP_TYPE_NAME.equals(
            OpenCms.getResourceManager().getResourceType(resource).getTypeName());
    }
959882
public String group(String groupName) {
        int idx = groupIndex(groupName);
        if (idx < 0) {
          throw new IndexOutOfBoundsException("No group \"" + groupName + "\"");
        }
        return group(idx);
    }
518521
public Observable<Page<SpatialAnchorsAccountInner>> listByResourceGroupAsync(final String resourceGroupName) {
        return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
            .map(new Func1<ServiceResponse<Page<SpatialAnchorsAccountInner>>, Page<SpatialAnchorsAccountInner>>() {
                @Override
                public Page<SpatialAnchorsAccountInner> call(ServiceResponse<Page<SpatialAnchorsAccountInner>> response) {
                    return response.body();
                }
            });
    }
64069
public boolean hasGroupsInOtherOus() {

        if (m_hasGroupsInOtherOus == null) {
            // lazzy initialization
            m_hasGroupsInOtherOus = Boolean.FALSE;
            try {
                List<CmsGroup> groups = getGroups(true);
                Iterator<CmsGroup> itGroups = groups.iterator();
                while (itGroups.hasNext()) {
                    CmsGroup group = itGroups.next();
                    if (!group.getOuFqn().equals(getParamOufqn())) {
                        m_hasGroupsInOtherOus = Boolean.TRUE;
                        break;
                    }
                }
            } catch (Exception e) {
                // ignore
            }
        }
        return m_hasGroupsInOtherOus.booleanValue();
    }
886446
public Observable<Page<VpnSiteInner>> listByResourceGroupAsync(final String resourceGroupName) {
        return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
            .map(new Func1<ServiceResponse<Page<VpnSiteInner>>, Page<VpnSiteInner>>() {
                @Override
                public Page<VpnSiteInner> call(ServiceResponse<Page<VpnSiteInner>> response) {
                    return response.body();
                }
            });
    }
1128171
public String translateGroupName(String groupName, boolean keepOu) {

        I_CmsGroupNameTranslation translation = getGroupNameTranslation();
        return translation.translateGroupName(groupName, keepOu);
    }
512608
public GroupEntity getGroup(String groupName) {
		return restClient.get("groups/" + groupName, GroupEntity.class, new HashMap<String, String>());
	}
228322
public Observable<Page<AvailabilitySetInner>> listByResourceGroupAsync(String resourceGroupName) {
        return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<AvailabilitySetInner>>, Page<AvailabilitySetInner>>() {
            @Override
            public Page<AvailabilitySetInner> call(ServiceResponse<List<AvailabilitySetInner>> response) {
                PageImpl<AvailabilitySetInner> page = new PageImpl<>();
                page.setItems(response.body());
                return page;
            }
        });
    }