{"action":"created","issue":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1376","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1376/labels{/name}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1376/comments","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1376/events","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1376","id":101024923,"number":1376,"title":"[WIP] Fix EZP-24701: Role versioning","user":{"login":"glye","id":289744,"avatar_url":"https://avatars.githubusercontent.com/u/289744?v=3","gravatar_id":"","url":"https://api.github.com/users/glye","html_url":"https://github.com/glye","followers_url":"https://api.github.com/users/glye/followers","following_url":"https://api.github.com/users/glye/following{/other_user}","gists_url":"https://api.github.com/users/glye/gists{/gist_id}","starred_url":"https://api.github.com/users/glye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glye/subscriptions","organizations_url":"https://api.github.com/users/glye/orgs","repos_url":"https://api.github.com/users/glye/repos","events_url":"https://api.github.com/users/glye/events{/privacy}","received_events_url":"https://api.github.com/users/glye/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2015-08-14T14:44:26Z","updated_at":"2015-08-21T14:33:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1376","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1376","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1376.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1376.patch"},"body":"Work in progress.\r\n\r\n~~Will add support for role `is_new` and `version`, and use them as in legacy.~~\r\nEdit: Implement similar way as for ContentType, with a RoleDraft class.\r\n\r\nhttps://jira.ez.no/browse/EZP-24701"},"comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments/133445086","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1376#issuecomment-133445086","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1376","id":133445086,"user":{"login":"ezrobot","id":681611,"avatar_url":"https://avatars.githubusercontent.com/u/681611?v=3","gravatar_id":"","url":"https://api.github.com/users/ezrobot","html_url":"https://github.com/ezrobot","followers_url":"https://api.github.com/users/ezrobot/followers","following_url":"https://api.github.com/users/ezrobot/following{/other_user}","gists_url":"https://api.github.com/users/ezrobot/gists{/gist_id}","starred_url":"https://api.github.com/users/ezrobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezrobot/subscriptions","organizations_url":"https://api.github.com/users/ezrobot/orgs","repos_url":"https://api.github.com/users/ezrobot/repos","events_url":"https://api.github.com/users/ezrobot/events{/privacy}","received_events_url":"https://api.github.com/users/ezrobot/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T14:33:27Z","updated_at":"2015-08-21T14:33:27Z","body":"This Pull Request does not respect [PSR-2 Coding Standards](http://www.php-fig.org/psr/psr-2/), please, see the suggested diff below:\n\n```diff\nLoaded config from \"/jenkins/jenkins.std/jobs/PAPI-Pull-Request-code-sniffer/workspace/.php_cs\"\n...................................F.....................\nLegend: ?-unknown, I-invalid file syntax, file ignored, .-no changes, F-fixed, E-error\n   1) eZ/Publish/Core/Persistence/Cache/UserHandler.php (return)\n      ---------- begin diff ----------\n      --- Original\n      +++ New\n      @@ @@\n               $this->logger->logCall(__METHOD__, array('role' => $roleId));\n      +\n               return $this->persistenceHandler->userHandler()->deleteRoleDraft($roleId);\n           }\n       \n           /**\n            * @see eZ\\Publish\\SPI\\Persistence\\User\\Handler::deleteRole\n            */\n           public function deleteRole($roleId)\n           {\n               $this->logger->logCall(__METHOD__, array('role' => $roleId));\n               $return = $this->persistenceHandler->userHandler()->deleteRole($roleId);\n       \n               $this->cache->clear('user', 'role', $roleId);\n               $this->cache->clear('user', 'role', 'assignments');\n       \n               return $return;\n           }\n       \n           /**\n            * @see eZ\\Publish\\SPI\\Persistence\\User\\Handler::addPolicy\n            */\n           public function addPolicy($roleId, Policy $policy)\n           {\n               $this->logger->logCall(__METHOD__, array('role' => $roleId, 'struct' => $policy));\n               $return = $this->persistenceHandler->userHandler()->addPolicy($roleId, $policy);\n       \n               $this->cache->clear('user', 'role', $roleId);\n       \n               return $return;\n           }\n       \n           /**\n            * @see eZ\\Publish\\SPI\\Persistence\\User\\Handler::updatePolicy\n            */\n           public function updatePolicy(Policy $policy)\n           {\n               $this->logger->logCall(__METHOD__, array('struct' => $policy));\n               $return = $this->persistenceHandler->userHandler()->updatePolicy($policy);\n       \n               $this->cache->clear('user', 'role', $policy->roleId);\n       \n               return $return;\n           }\n       \n           /**\n            * @see eZ\\Publish\\SPI\\Persistence\\User\\Handler::deletePolicy\n            */\n           public function deletePolicy($policyId)\n           {\n               $this->logger->logCall(__METHOD__, array('policy' => $policyId));\n               $this->persistenceHandler->userHandler()->deletePolicy($policyId);\n       \n               $this->cache->clear('user', 'role');\n           }\n       \n           /**\n            * @see eZ\\Publish\\SPI\\Persistence\\User\\Handler::loadPoliciesByUserId\n            */\n           public function loadPoliciesByUserId($userId)\n           {\n               $this->logger->logCall(__METHOD__, array('user' => $userId));\n       \n               return $this->persistenceHandler->userHandler()->loadPoliciesByUserId($userId);\n           }\n       \n           /**\n            * @see eZ\\Publish\\SPI\\Persistence\\User\\Handler::assignRole\n            */\n           public function assignRole($contentId, $roleId, array $limitation = null)\n           {\n               $this->logger->logCall(__METHOD__, array('group' => $contentId, 'role' => $roleId, 'limitation' => $limitation));\n               $return = $this->persistenceHandler->userHandler()->assignRole($contentId, $roleId, $limitation);\n       \n               $this->cache->clear('user', 'role', $roleId);\n               $this->cache->clear('user', 'role', 'assignments', 'byGroup', $contentId);\n               $this->cache->clear('user', 'role', 'assignments', 'byGroup', 'inherited');\n       \n               return $return;\n           }\n       \n           /**\n            * @see eZ\\Publish\\SPI\\Persistence\\User\\Handler::unAssignRole\n            */\n           public function unAssignRole($contentId, $roleId)\n           {\n               $this->logger->logCall(__METHOD__, array('group' => $contentId, 'role' => $roleId));\n               $return = $this->persistenceHandler->userHandler()->unAssignRole($contentId, $roleId);\n       \n               $this->cache->clear('user', 'role', $roleId);\n               $this->cache->clear('user', 'role', 'assignments', 'byGroup', $contentId);\n               $this->cache->clear('user', 'role', 'assignments', 'byGroup', 'inherited');\n       \n               return $return;\n           }\n       }\n       \n      \n      ---------- end diff ----------\n\nFixed all files in 105.717 seconds, 22.500 MB memory used\n```\n"}}