public function deleteUserGroup($groupPath)
    {
        $userGroupLocation = $this->locationService->loadLocation(
            $this->extractLocationIdFromPath($groupPath)
        );

        $userGroup = $this->userService->loadUserGroup(
            $userGroupLocation->contentId
        );

        // Load one user to see if user group is empty or not
        $users = $this->userService->loadUsersOfUserGroup($userGroup, 0, 1);
        if (!empty($users)) {
            throw new Exceptions\ForbiddenException('Non-empty user groups cannot be deleted');
        }

        $this->userService->deleteUserGroup($userGroup);

        return new Values\NoContent();
    }
public function deleteUserGroup($groupPath)
    {
        $userGroupLocation = $this->locationService->loadLocation(
            $this->extractLocationIdFromPath($groupPath)
        );

        $userGroup = $this->userService->loadUserGroup(
            $userGroupLocation->contentId
        );

        // Load one user to see if user group is empty or not
        $users = $this->userService->loadUsersOfUserGroup($userGroup, 0, 1);
        if (!empty($users)) {
            throw new Exceptions\ForbiddenException('Non-empty user groups cannot be deleted');
        }

        $this->userService->deleteUserGroup($userGroup);

        return new Values\NoContent();
    }
public function deleteUserGroup ( $ groupPath ) { $ userGroupLocation = $ this -> locationService -> loadLocation ( $ this -> extractLocationIdFromPath ( $ groupPath ) ) ; $ userGroup = $ this -> userService -> loadUserGroup ( $ userGroupLocation -> contentId ) ; // Load one user to see if user group is empty or not $ users = $ this -> userService -> loadUsersOfUserGroup ( $ userGroup , 0 , 1 ) ; if ( ! empty ( $ users ) ) { throw new Exceptions \ ForbiddenException ( 'Non-empty user groups cannot be deleted' ) ; } $ this -> userService -> deleteUserGroup ( $ userGroup ) ; return new Values \ NoContent ( ) ; }
Given user group is deleted.

@param $groupPath

@throws \eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException

@return \eZ\Publish\Core\REST\Server\Values\NoContent
Given user group is deleted .