/** * @inheritdoc */ public function create(UserRightSpecInterface $spec) { $userId = $spec->getUserId(); $action = $spec->getAction(); $object = $spec->getObject(); $rightId = $this->rightService->getRight($action, $object)->getId(); $forObjectGroup = $spec->getForObjectGroup(); $withId = $spec->getWithObjectId(); return $this->userRightService->createUserRight($userId, $rightId, $forObjectGroup, $withId); }