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()}'.");
    }
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()}'.");
    }
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()}'." ) ; }
Returns a role assignment to the given user group.

@param $groupPath
@param $roleId

@throws \eZ\Publish\Core\REST\Common\Exceptions\NotFoundException

@return \eZ\Publish\Core\REST\Server\Values\RestUserGroupRoleAssignment
Returns a role assignment to the given user group .