{"action":"opened","number":50,"pull_request":{"url":"https://api.github.com/repos/fago/entity/pulls/50","id":141049776,"html_url":"https://github.com/fago/entity/pull/50","diff_url":"https://github.com/fago/entity/pull/50.diff","patch_url":"https://github.com/fago/entity/pull/50.patch","issue_url":"https://api.github.com/repos/fago/entity/issues/50","number":50,"state":"open","locked":false,"title":"Add a query_access handler to limit lists","user":{"login":"dawehner","id":29678,"avatar_url":"https://avatars0.githubusercontent.com/u/29678?v=4","gravatar_id":"","url":"https://api.github.com/users/dawehner","html_url":"https://github.com/dawehner","followers_url":"https://api.github.com/users/dawehner/followers","following_url":"https://api.github.com/users/dawehner/following{/other_user}","gists_url":"https://api.github.com/users/dawehner/gists{/gist_id}","starred_url":"https://api.github.com/users/dawehner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dawehner/subscriptions","organizations_url":"https://api.github.com/users/dawehner/orgs","repos_url":"https://api.github.com/users/dawehner/repos","events_url":"https://api.github.com/users/dawehner/events{/privacy}","received_events_url":"https://api.github.com/users/dawehner/received_events","type":"User","site_admin":false},"body":"The access control handler of entities enable to check access based upon some conditions.\r\n\r\nThese access control handlers though are not applied to list queries produced by entity query and views. The node entity type provides one solution for this (node grant access), but its overly complex for most usecases.\r\n\r\nCommerce in D7 had good experience with basically filtering by properties.\r\n\r\nArchitecture:\r\n\r\n* Add a ```Condition``` object which describes a list of conditions (field, value, operator) together with a conjunction (AND/OR) and nested conditions.\r\n* Add a ```query_access``` handler type which return a ```Condition``` object. Entity type should try to implement one which matches their access handlers\r\n* Add some glue code to alter the sql queries produce by entity query and views. This glue code reaches out to the query access handler to get the conditions it should apply.\r\n\r\nPotential todos:\r\n  * [ ]  Expand the test coverage starting with initial OR conditions on the entity query itself","created_at":"2017-09-14T11:32:54Z","updated_at":"2017-09-14T11:32:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/fago/entity/pulls/50/commits","review_comments_url":"https://api.github.com/repos/fago/entity/pulls/50/comments","review_comment_url":"https://api.github.com/repos/fago/entity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fago/entity/issues/50/comments","statuses_url":"https://api.github.com/repos/fago/entity/statuses/1be69f1f157b0e8827a67efa6bfa08b71008942b","head":{"label":"dawehner:query-access-conditions","ref":"query-access-conditions","sha":"1be69f1f157b0e8827a67efa6bfa08b71008942b","user":{"login":"dawehner","id":29678,"avatar_url":"https://avatars0.githubusercontent.com/u/29678?v=4","gravatar_id":"","url":"https://api.github.com/users/dawehner","html_url":"https://github.com/dawehner","followers_url":"https://api.github.com/users/dawehner/followers","following_url":"https://api.github.com/users/dawehner/following{/other_user}","gists_url":"https://api.github.com/users/dawehner/gists{/gist_id}","starred_url":"https://api.github.com/users/dawehner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dawehner/subscriptions","organizations_url":"https://api.github.com/users/dawehner/orgs","repos_url":"https://api.github.com/users/dawehner/repos","events_url":"https://api.github.com/users/dawehner/events{/privacy}","received_events_url":"https://api.github.com/users/dawehner/received_events","type":"User","site_admin":false},"repo":{"id":44981575,"name":"entity","full_name":"dawehner/entity","owner":{"login":"dawehner","id":29678,"avatar_url":"https://avatars0.githubusercontent.com/u/29678?v=4","gravatar_id":"","url":"https://api.github.com/users/dawehner","html_url":"https://github.com/dawehner","followers_url":"https://api.github.com/users/dawehner/followers","following_url":"https://api.github.com/users/dawehner/following{/other_user}","gists_url":"https://api.github.com/users/dawehner/gists{/gist_id}","starred_url":"https://api.github.com/users/dawehner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dawehner/subscriptions","organizations_url":"https://api.github.com/users/dawehner/orgs","repos_url":"https://api.github.com/users/dawehner/repos","events_url":"https://api.github.com/users/dawehner/events{/privacy}","received_events_url":"https://api.github.com/users/dawehner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dawehner/entity","description":"http://drupal.org/project/entity development for Drupal 8.","fork":true,"url":"https://api.github.com/repos/dawehner/entity","forks_url":"https://api.github.com/repos/dawehner/entity/forks","keys_url":"https://api.github.com/repos/dawehner/entity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dawehner/entity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dawehner/entity/teams","hooks_url":"https://api.github.com/repos/dawehner/entity/hooks","issue_events_url":"https://api.github.com/repos/dawehner/entity/issues/events{/number}","events_url":"https://api.github.com/repos/dawehner/entity/events","assignees_url":"https://api.github.com/repos/dawehner/entity/assignees{/user}","branches_url":"https://api.github.com/repos/dawehner/entity/branches{/branch}","tags_url":"https://api.github.com/repos/dawehner/entity/tags","blobs_url":"https://api.github.com/repos/dawehner/entity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dawehner/entity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dawehner/entity/git/refs{/sha}","trees_url":"https://api.github.com/repos/dawehner/entity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dawehner/entity/statuses/{sha}","languages_url":"https://api.github.com/repos/dawehner/entity/languages","stargazers_url":"https://api.github.com/repos/dawehner/entity/stargazers","contributors_url":"https://api.github.com/repos/dawehner/entity/contributors","subscribers_url":"https://api.github.com/repos/dawehner/entity/subscribers","subscription_url":"https://api.github.com/repos/dawehner/entity/subscription","commits_url":"https://api.github.com/repos/dawehner/entity/commits{/sha}","git_commits_url":"https://api.github.com/repos/dawehner/entity/git/commits{/sha}","comments_url":"https://api.github.com/repos/dawehner/entity/comments{/number}","issue_comment_url":"https://api.github.com/repos/dawehner/entity/issues/comments{/number}","contents_url":"https://api.github.com/repos/dawehner/entity/contents/{+path}","compare_url":"https://api.github.com/repos/dawehner/entity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dawehner/entity/merges","archive_url":"https://api.github.com/repos/dawehner/entity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dawehner/entity/downloads","issues_url":"https://api.github.com/repos/dawehner/entity/issues{/number}","pulls_url":"https://api.github.com/repos/dawehner/entity/pulls{/number}","milestones_url":"https://api.github.com/repos/dawehner/entity/milestones{/number}","notifications_url":"https://api.github.com/repos/dawehner/entity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dawehner/entity/labels{/name}","releases_url":"https://api.github.com/repos/dawehner/entity/releases{/id}","deployments_url":"https://api.github.com/repos/dawehner/entity/deployments","created_at":"2015-10-26T16:25:56Z","updated_at":"2016-01-12T18:38:22Z","pushed_at":"2017-09-14T11:24:09Z","git_url":"git://github.com/dawehner/entity.git","ssh_url":"git@github.com:dawehner/entity.git","clone_url":"https://github.com/dawehner/entity.git","svn_url":"https://github.com/dawehner/entity","homepage":null,"size":186,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"8.x-1.x"}},"base":{"label":"fago:8.x-1.x","ref":"8.x-1.x","sha":"d858740896850d96cd062b03393867eac8dfdff1","user":{"login":"fago","id":132232,"avatar_url":"https://avatars2.githubusercontent.com/u/132232?v=4","gravatar_id":"","url":"https://api.github.com/users/fago","html_url":"https://github.com/fago","followers_url":"https://api.github.com/users/fago/followers","following_url":"https://api.github.com/users/fago/following{/other_user}","gists_url":"https://api.github.com/users/fago/gists{/gist_id}","starred_url":"https://api.github.com/users/fago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fago/subscriptions","organizations_url":"https://api.github.com/users/fago/orgs","repos_url":"https://api.github.com/users/fago/repos","events_url":"https://api.github.com/users/fago/events{/privacy}","received_events_url":"https://api.github.com/users/fago/received_events","type":"User","site_admin":false},"repo":{"id":44748674,"name":"entity","full_name":"fago/entity","owner":{"login":"fago","id":132232,"avatar_url":"https://avatars2.githubusercontent.com/u/132232?v=4","gravatar_id":"","url":"https://api.github.com/users/fago","html_url":"https://github.com/fago","followers_url":"https://api.github.com/users/fago/followers","following_url":"https://api.github.com/users/fago/following{/other_user}","gists_url":"https://api.github.com/users/fago/gists{/gist_id}","starred_url":"https://api.github.com/users/fago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fago/subscriptions","organizations_url":"https://api.github.com/users/fago/orgs","repos_url":"https://api.github.com/users/fago/repos","events_url":"https://api.github.com/users/fago/events{/privacy}","received_events_url":"https://api.github.com/users/fago/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fago/entity","description":"http://drupal.org/project/entity development for Drupal 8.","fork":false,"url":"https://api.github.com/repos/fago/entity","forks_url":"https://api.github.com/repos/fago/entity/forks","keys_url":"https://api.github.com/repos/fago/entity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fago/entity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fago/entity/teams","hooks_url":"https://api.github.com/repos/fago/entity/hooks","issue_events_url":"https://api.github.com/repos/fago/entity/issues/events{/number}","events_url":"https://api.github.com/repos/fago/entity/events","assignees_url":"https://api.github.com/repos/fago/entity/assignees{/user}","branches_url":"https://api.github.com/repos/fago/entity/branches{/branch}","tags_url":"https://api.github.com/repos/fago/entity/tags","blobs_url":"https://api.github.com/repos/fago/entity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fago/entity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fago/entity/git/refs{/sha}","trees_url":"https://api.github.com/repos/fago/entity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fago/entity/statuses/{sha}","languages_url":"https://api.github.com/repos/fago/entity/languages","stargazers_url":"https://api.github.com/repos/fago/entity/stargazers","contributors_url":"https://api.github.com/repos/fago/entity/contributors","subscribers_url":"https://api.github.com/repos/fago/entity/subscribers","subscription_url":"https://api.github.com/repos/fago/entity/subscription","commits_url":"https://api.github.com/repos/fago/entity/commits{/sha}","git_commits_url":"https://api.github.com/repos/fago/entity/git/commits{/sha}","comments_url":"https://api.github.com/repos/fago/entity/comments{/number}","issue_comment_url":"https://api.github.com/repos/fago/entity/issues/comments{/number}","contents_url":"https://api.github.com/repos/fago/entity/contents/{+path}","compare_url":"https://api.github.com/repos/fago/entity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fago/entity/merges","archive_url":"https://api.github.com/repos/fago/entity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fago/entity/downloads","issues_url":"https://api.github.com/repos/fago/entity/issues{/number}","pulls_url":"https://api.github.com/repos/fago/entity/pulls{/number}","milestones_url":"https://api.github.com/repos/fago/entity/milestones{/number}","notifications_url":"https://api.github.com/repos/fago/entity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fago/entity/labels{/name}","releases_url":"https://api.github.com/repos/fago/entity/releases{/id}","deployments_url":"https://api.github.com/repos/fago/entity/deployments","created_at":"2015-10-22T13:56:53Z","updated_at":"2017-05-31T04:20:21Z","pushed_at":"2017-09-12T12:25:50Z","git_url":"git://github.com/fago/entity.git","ssh_url":"git@github.com:fago/entity.git","clone_url":"https://github.com/fago/entity.git","svn_url":"https://github.com/fago/entity","homepage":null,"size":784,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":16,"forks":12,"open_issues":16,"watchers":3,"default_branch":"8.x-1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/fago/entity/pulls/50"},"html":{"href":"https://github.com/fago/entity/pull/50"},"issue":{"href":"https://api.github.com/repos/fago/entity/issues/50"},"comments":{"href":"https://api.github.com/repos/fago/entity/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/fago/entity/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/fago/entity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fago/entity/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/fago/entity/statuses/1be69f1f157b0e8827a67efa6bfa08b71008942b"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":9,"additions":823,"deletions":0,"changed_files":11}}
{"actor":{"display_login":"dawehner"}}