/**
  * Changes the priority of the state
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to change priority on an object state
  *
  * @param \eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState
  * @param int $priority
  */
 public function setPriorityOfObjectState(ObjectState $objectState, $priority)
 {
     if (false === $this->repository->hasAccess('class', '*')) {
         throw new Exceptions\UnauthorizedExceptionStub('What error code should be used?');
     }
     $objectState->setPriority($priority);
     $this->renumberPriorities($objectState->stateGroup);
 }