Loads role assignments for specified content ID.

@param mixed $groupId
@param bool $inherited

@return array
971461
public function loadRoleAssignmentsByGroupId($groupId, $inherited = false)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('id'),
            $this->handler->quoteColumn('contentobject_id'),
            $this->handler->quoteColumn('limit_identifier'),
            $this->handler->quoteColumn('limit_value'),
            $this->handler->quoteColumn('role_id')
        )->from(
            $this->handler->quoteTable('ezuser_role')
        );

        if ($inherited) {
            $groupIds = $this->fetchUserGroups($groupId);
            $groupIds[] = $groupId;
            $query->where(
                $query->expr->in(
                    $this->handler->quoteColumn('contentobject_id'),
                    $groupIds
                )
            );
        } else {
            $query->where(
                $query->expr->eq(
                    $this->handler->quoteColumn('contentobject_id'),
                    $query->bindValue($groupId, null, \PDO::PARAM_INT)
                )
            );
        }

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
14009
public function assignRole($contentId, $roleId, array $limitation)
    {
        try {
            return $this->innerGateway->assignRole($contentId, $roleId, $limitation);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
105121
public function loadRoleAssignmentsByRoleId($roleId)
    {
        try {
            return $this->innerGateway->loadRoleAssignmentsByRoleId($roleId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
894243
public function loadRoleAssignmentForUserGroup($groupPath, $roleId, Request $request)
    {
        $groupLocationParts = explode('/', $groupPath);
        $groupLocation = $this->locationService->loadLocation(array_pop($groupLocationParts));
        $userGroup = $this->userService->loadUserGroup($groupLocation->contentId);

        $roleAssignments = $this->roleService->getRoleAssignmentsForUserGroup($userGroup);
        foreach ($roleAssignments as $roleAssignment) {
            if ($roleAssignment->getRole()->id == $roleId) {
                return new Values\RestUserGroupRoleAssignment($roleAssignment, $groupPath);
            }
        }

        throw new Exceptions\NotFoundException("Role assignment not found: '{$request->getPathInfo()}'.");
    }
672293
public function sendGetGroupV2Info($groupID)
    {
        $msgId = $this->nodeId['get_groupv2_info'] = $this->createIqId();

        $queryNode = new ProtocolNode('query',
            [
                'request' => 'interactive',
            ], null, null);

        $node = new ProtocolNode('iq',
            [
                'id'    => $msgId,
                'xmlns' => 'w:g2',
                'type'  => 'get',
                'to'    => $this->getJID($groupID),
            ], [$queryNode], null);

        $this->sendNode($node);
    }
400587
@NotNull
    @ObjectiveCName("loadGroupPermissionsWithGid:")
    public Promise<GroupPermissions> loadGroupPermissions(int gid) {
        return modules.getGroupsModule().loadAdminSettings(gid);
    }
1206151
private function loadActualDataForSortedReferenceManyCollectionByIds(
        PersistentCollection $collection,
        array $groupedIds
    ) {
        $mapping = $collection->getMapping();
        $hints = $collection->getHints();

        foreach ($groupedIds as $className => $ids) {
            $class = $this->dm->getClassMetadata($className);
            $mongoCollection = $this->dm->getDocumentCollection($className);
            $criteria = $this->cm->merge(
                array('_id' => array('$in' => array_values($ids))),
                $this->dm->getFilterCollection()->getFilterCriteria($class),
                isset($mapping['criteria']) ? $mapping['criteria'] : array()
            );
            $criteria = $this->uow->getDocumentPersister($className)->prepareQueryOrNewObj(
                $criteria
            );
            $cursor = $mongoCollection->find($criteria);
            if (isset($mapping['sort'])) {
                $cursor->sort($mapping['sort']);
            }
            if (isset($mapping['limit'])) {
                $cursor->limit($mapping['limit']);
            }
            if (isset($mapping['skip'])) {
                $cursor->skip($mapping['skip']);
            }
            if (!empty($hints[Query::HINT_SLAVE_OKAY])) {
                $cursor->slaveOkay(true);
            }
            if (!empty($hints[Query::HINT_READ_PREFERENCE])) {
                $cursor->setReadPreference(
                    $hints[Query::HINT_READ_PREFERENCE],
                    $hints[Query::HINT_READ_PREFERENCE_TAGS]
                );
            }
            $documents = $cursor->toArray(false);
            foreach ($documents as $documentData) {
                $docId = $documentData['_id'];
                $document = $this->uow->getById($docId, $class);
                $data = $this->hydratorFactory->hydrate($document, $documentData);
                $this->uow->setOriginalDocumentData($document, $data);
                $document->__isInitialized__ = true;
                $collection->add($document);
            }
        }
    }
13733
public function updateGroup($groupId, InputStruct $input)
    {
        $objectStateGroup = $this->objectStateMapper->createObjectStateGroupFromInputStruct($input);
        $objectStateGroup->id = (int)$groupId;

        $this->objectStateGateway->updateObjectStateGroup($objectStateGroup);

        return $this->loadGroup($objectStateGroup->id);
    }
443101
public function deleteAction($groupId)
    {
        $group = $this->get('open_orchestra_user.repository.group')->find($groupId);
        $this->denyAccessUnlessGranted(ContributionActionInterface::DELETE, $group);

        if ($group instanceof GroupInterface && $this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::DELETE, $group)) {
            $objectManager = $this->get('object_manager');
            $objectManager->remove($group);
            $objectManager->flush();
            $this->dispatchEvent(GroupEvents::GROUP_DELETE, new GroupEvent($group));
        }

        return array();
    }
724914
public function findAllForGroup($groupId)
    {
        if (!$groupId) {
            return [];
        }

        if (!is_array($groupId)) {
            $groupId = [$groupId];
        }

        $cacheKey = join('_', $groupId);

        $permissions = Cache::remember($cacheKey, function () use ($groupId) {
            return $this
                ->find('list', [
                    'keyField' => 'path',
                    'valueField' => 'allowed'
                ])
                ->where([
                    'group_id IN' => $groupId,
                    'allowed >' => 0
                ])
                ->order('allowed DESC')
                ->hydrate(false)
                ->toArray();
        }, 'wasabi/core/group_permissions');

        return $permissions;
    }
3833
public function load(AggregateId $aggregateId)
    {
        $result = $this->getEntityManager()->find($aggregateId->aggregateClass(), $aggregateId->value());
        Preconditions::checkArgument($result !== null, 'Aggregate with ID [%s] does not exist', $aggregateId);
        return $result;
    }
1178110
public function getGroupsByRoles(array $roles, $page = 1, $max = 50, $orderedBy = 'id', $order = null)
    {
        $query = $this->groupRepo->findByRoles($roles, true, $orderedBy, $order);

        return $this->pagerFactory->createPager($query, $page, $max);
    }
956018
public List<GitlabGroupMember> getGroupMembers(Integer groupId) {
        String tailUrl = GitlabGroup.URL + "/" + groupId + GitlabGroupMember.URL + PARAM_MAX_ITEMS_PER_PAGE;
        return retrieve().getAll(tailUrl, GitlabGroupMember[].class);
    }
755105
public function loadObjectStateGroupData($groupId)
    {
        $query = $this->createObjectStateGroupFindQuery();
        $query->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('id', 'ezcobj_state_group'),
                $query->bindValue($groupId, null, \PDO::PARAM_INT)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
810121
public function assignRole($contentId, $roleId, array $limitation)
    {
        foreach ($limitation as $identifier => $values) {
            foreach ($values as $value) {
                $query = $this->handler->createInsertQuery();
                $query
                    ->insertInto($this->handler->quoteTable('ezuser_role'))
                    ->set(
                        $this->handler->quoteColumn('contentobject_id'),
                        $query->bindValue($contentId, null, \PDO::PARAM_INT)
                    )->set(
                        $this->handler->quoteColumn('role_id'),
                        $query->bindValue($roleId, null, \PDO::PARAM_INT)
                    )->set(
                        $this->handler->quoteColumn('limit_identifier'),
                        $query->bindValue($identifier)
                    )->set(
                        $this->handler->quoteColumn('limit_value'),
                        $query->bindValue($value)
                    );
                $query->prepare()->execute();
            }
        }
    }
435342
public function assignRole($roleId = null)
    {
        $roles = $this->roles;

        if (! $roles->contains($roleId)) {
            return $this->roles()->attach($roleId);
        }

        return false;
    }
1119286
public function isGroupPermissionInheritNode(Group $group)
    {
        $definition = (new Query())->select("inheritance")->from("cms_nav_permission")->where(['group_id' => $group->id, 'nav_id' => $this->id])->one();
        
        if ($definition) {
            return (bool) $definition['inheritance'];
        }
        
        return false;
    }