{"action":"created","issue":{"url":"https://api.github.com/repos/Elgg/Elgg/issues/9716","repository_url":"https://api.github.com/repos/Elgg/Elgg","labels_url":"https://api.github.com/repos/Elgg/Elgg/issues/9716/labels{/name}","comments_url":"https://api.github.com/repos/Elgg/Elgg/issues/9716/comments","events_url":"https://api.github.com/repos/Elgg/Elgg/issues/9716/events","html_url":"https://github.com/Elgg/Elgg/pull/9716","id":148949173,"number":9716,"title":"New capabilities service, improved container API","user":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-17T12:54:03Z","updated_at":"2016-04-17T23:08:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/9716","html_url":"https://github.com/Elgg/Elgg/pull/9716","diff_url":"https://github.com/Elgg/Elgg/pull/9716.diff","patch_url":"https://github.com/Elgg/Elgg/pull/9716.patch"},"body":"**feature(entities): adds user capabilities service and tests**\r\nAdds ``\\Elgg\\UserCapabilities`` service and proxies ``ElggEntity::can*()`` methods.\r\nAdds PHPUnit tests for user capabilities\r\n\r\n**feature(entities): container logic is now checked before permissions**\r\nAdds ``\"container_logic_check, <entity_type>\"`` hook, which can be used to apply containment logic before checking container permissions. This hook can be used to prevent certain entity types from containing other entity types regardless of edit and write permissions, e.g. discussion replies should\r\nalways be contained by discussion objects, or discussion replies should not be allowed in closed discussions.\r\nFixes #9695\r\n\r\n**feature(discussions): more accurate container checks**\r\nDiscussion replies can now only be added to discussions. New replies are no longer allowed in closed discussions.\r\nUses ``\"container_logic_check\"`` hook to apply contaiment rules regardless of access overrides.\r\nRefs #9695\r\nRefs #9698"},"comment":{"url":"https://api.github.com/repos/Elgg/Elgg/issues/comments/211126845","html_url":"https://github.com/Elgg/Elgg/pull/9716#issuecomment-211126845","issue_url":"https://api.github.com/repos/Elgg/Elgg/issues/9716","id":211126845,"user":{"login":"mrclay","id":170687,"avatar_url":"https://avatars.githubusercontent.com/u/170687?v=3","gravatar_id":"","url":"https://api.github.com/users/mrclay","html_url":"https://github.com/mrclay","followers_url":"https://api.github.com/users/mrclay/followers","following_url":"https://api.github.com/users/mrclay/following{/other_user}","gists_url":"https://api.github.com/users/mrclay/gists{/gist_id}","starred_url":"https://api.github.com/users/mrclay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrclay/subscriptions","organizations_url":"https://api.github.com/users/mrclay/orgs","repos_url":"https://api.github.com/users/mrclay/repos","events_url":"https://api.github.com/users/mrclay/events{/privacy}","received_events_url":"https://api.github.com/users/mrclay/received_events","type":"User","site_admin":false},"created_at":"2016-04-17T23:08:16Z","updated_at":"2016-04-17T23:08:16Z","body":"I like a lot that this centralizes the capabilities logic.\r\n\r\nThe complexity of the test mocking makes me nervous, but since the capabilities mostly depends on hooks and attributes (not deep queries) I think this is a good addition. Would be nice to remove duplicate test functionality from simpletests. I'll try to identify some of that."}}