{"action":"closed","number":8778,"pull_request":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/8778","id":41375202,"html_url":"https://github.com/Elgg/Elgg/pull/8778","diff_url":"https://github.com/Elgg/Elgg/pull/8778.diff","patch_url":"https://github.com/Elgg/Elgg/pull/8778.patch","issue_url":"https://api.github.com/repos/Elgg/Elgg/issues/8778","number":8778,"state":"closed","locked":false,"title":"fix(entities): Entity creation no longer needlessly checks owner container","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},"body":"BREAKING CHANGE:\r\nWhen creating within a group, ElggEntity::create used to always separately check if the current user can use the owner's account as a container. This made sure that one group member could not post to the group using another member as owner. This separate check led to confusion, as handlers of the container_permissions_check hook were told that the owner was to be the container, when it was actually the group.\r\n\r\nHere we bypass the separate owner container check if the desired owner_guid is the logged in user GUID. This eliminates the check under all normal circumstances but leaves it in place in case a poorly coded plugin allows the impersonation described above.\r\n\r\nThis also denies creation if the owner/container GUIDs are set but can't be loaded. Before, create() would simply bypass the permissions check if it couldn't load the owner/container.\r\n\r\nFixes #4231\r\n\r\n(This is a modest change that eliminates the most common cases of #4231, but ultimately I think #8790 is the future)\r\n\r\n- [x] log cases where return false\r\n- [x] fix typo in docs","created_at":"2015-07-31T19:57:31Z","updated_at":"2015-08-15T04:17:22Z","closed_at":"2015-08-15T04:17:22Z","merged_at":"2015-08-15T04:17:21Z","merge_commit_sha":"96b45b0c32e2cbdf1fc3e3804f733a79798416cd","assignee":null,"milestone":{"url":"https://api.github.com/repos/Elgg/Elgg/milestones/60","html_url":"https://github.com/Elgg/Elgg/milestones/Elgg%202.0.x","labels_url":"https://api.github.com/repos/Elgg/Elgg/milestones/60/labels","id":404754,"number":60,"title":"Elgg 2.0.x","description":"","creator":{"login":"ewinslow","id":356564,"avatar_url":"https://avatars.githubusercontent.com/u/356564?v=3","gravatar_id":"","url":"https://api.github.com/users/ewinslow","html_url":"https://github.com/ewinslow","followers_url":"https://api.github.com/users/ewinslow/followers","following_url":"https://api.github.com/users/ewinslow/following{/other_user}","gists_url":"https://api.github.com/users/ewinslow/gists{/gist_id}","starred_url":"https://api.github.com/users/ewinslow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewinslow/subscriptions","organizations_url":"https://api.github.com/users/ewinslow/orgs","repos_url":"https://api.github.com/users/ewinslow/repos","events_url":"https://api.github.com/users/ewinslow/events{/privacy}","received_events_url":"https://api.github.com/users/ewinslow/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":97,"state":"open","created_at":"2013-08-19T00:23:53Z","updated_at":"2015-08-15T04:17:22Z","due_on":"2015-08-17T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Elgg/Elgg/pulls/8778/commits","review_comments_url":"https://api.github.com/repos/Elgg/Elgg/pulls/8778/comments","review_comment_url":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Elgg/Elgg/issues/8778/comments","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/5adf98fd83e6c15a6f417b63e02f1fb4f0c3fcb4","head":{"label":"mrclay:create_container_4231","ref":"create_container_4231","sha":"5adf98fd83e6c15a6f417b63e02f1fb4f0c3fcb4","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},"repo":{"id":2142685,"name":"Elgg-leaf","full_name":"mrclay/Elgg-leaf","owner":{"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},"private":false,"html_url":"https://github.com/mrclay/Elgg-leaf","description":"A social networking engine","fork":true,"url":"https://api.github.com/repos/mrclay/Elgg-leaf","forks_url":"https://api.github.com/repos/mrclay/Elgg-leaf/forks","keys_url":"https://api.github.com/repos/mrclay/Elgg-leaf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrclay/Elgg-leaf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrclay/Elgg-leaf/teams","hooks_url":"https://api.github.com/repos/mrclay/Elgg-leaf/hooks","issue_events_url":"https://api.github.com/repos/mrclay/Elgg-leaf/issues/events{/number}","events_url":"https://api.github.com/repos/mrclay/Elgg-leaf/events","assignees_url":"https://api.github.com/repos/mrclay/Elgg-leaf/assignees{/user}","branches_url":"https://api.github.com/repos/mrclay/Elgg-leaf/branches{/branch}","tags_url":"https://api.github.com/repos/mrclay/Elgg-leaf/tags","blobs_url":"https://api.github.com/repos/mrclay/Elgg-leaf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrclay/Elgg-leaf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrclay/Elgg-leaf/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrclay/Elgg-leaf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrclay/Elgg-leaf/statuses/{sha}","languages_url":"https://api.github.com/repos/mrclay/Elgg-leaf/languages","stargazers_url":"https://api.github.com/repos/mrclay/Elgg-leaf/stargazers","contributors_url":"https://api.github.com/repos/mrclay/Elgg-leaf/contributors","subscribers_url":"https://api.github.com/repos/mrclay/Elgg-leaf/subscribers","subscription_url":"https://api.github.com/repos/mrclay/Elgg-leaf/subscription","commits_url":"https://api.github.com/repos/mrclay/Elgg-leaf/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrclay/Elgg-leaf/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrclay/Elgg-leaf/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrclay/Elgg-leaf/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrclay/Elgg-leaf/contents/{+path}","compare_url":"https://api.github.com/repos/mrclay/Elgg-leaf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrclay/Elgg-leaf/merges","archive_url":"https://api.github.com/repos/mrclay/Elgg-leaf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrclay/Elgg-leaf/downloads","issues_url":"https://api.github.com/repos/mrclay/Elgg-leaf/issues{/number}","pulls_url":"https://api.github.com/repos/mrclay/Elgg-leaf/pulls{/number}","milestones_url":"https://api.github.com/repos/mrclay/Elgg-leaf/milestones{/number}","notifications_url":"https://api.github.com/repos/mrclay/Elgg-leaf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrclay/Elgg-leaf/labels{/name}","releases_url":"https://api.github.com/repos/mrclay/Elgg-leaf/releases{/id}","created_at":"2011-08-02T13:45:11Z","updated_at":"2014-06-24T23:34:38Z","pushed_at":"2015-08-15T03:53:46Z","git_url":"git://github.com/mrclay/Elgg-leaf.git","ssh_url":"git@github.com:mrclay/Elgg-leaf.git","clone_url":"https://github.com/mrclay/Elgg-leaf.git","svn_url":"https://github.com/mrclay/Elgg-leaf","homepage":"http://elgg.org","size":45096,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"Elgg:master","ref":"master","sha":"eb5837b4993830fd50bc84557e4371d2fd791127","user":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"repo":{"id":299271,"name":"Elgg","full_name":"Elgg/Elgg","owner":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Elgg/Elgg","description":"A social networking engine in PHP/MySQL","fork":false,"url":"https://api.github.com/repos/Elgg/Elgg","forks_url":"https://api.github.com/repos/Elgg/Elgg/forks","keys_url":"https://api.github.com/repos/Elgg/Elgg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Elgg/Elgg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Elgg/Elgg/teams","hooks_url":"https://api.github.com/repos/Elgg/Elgg/hooks","issue_events_url":"https://api.github.com/repos/Elgg/Elgg/issues/events{/number}","events_url":"https://api.github.com/repos/Elgg/Elgg/events","assignees_url":"https://api.github.com/repos/Elgg/Elgg/assignees{/user}","branches_url":"https://api.github.com/repos/Elgg/Elgg/branches{/branch}","tags_url":"https://api.github.com/repos/Elgg/Elgg/tags","blobs_url":"https://api.github.com/repos/Elgg/Elgg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Elgg/Elgg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Elgg/Elgg/git/refs{/sha}","trees_url":"https://api.github.com/repos/Elgg/Elgg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/{sha}","languages_url":"https://api.github.com/repos/Elgg/Elgg/languages","stargazers_url":"https://api.github.com/repos/Elgg/Elgg/stargazers","contributors_url":"https://api.github.com/repos/Elgg/Elgg/contributors","subscribers_url":"https://api.github.com/repos/Elgg/Elgg/subscribers","subscription_url":"https://api.github.com/repos/Elgg/Elgg/subscription","commits_url":"https://api.github.com/repos/Elgg/Elgg/commits{/sha}","git_commits_url":"https://api.github.com/repos/Elgg/Elgg/git/commits{/sha}","comments_url":"https://api.github.com/repos/Elgg/Elgg/comments{/number}","issue_comment_url":"https://api.github.com/repos/Elgg/Elgg/issues/comments{/number}","contents_url":"https://api.github.com/repos/Elgg/Elgg/contents/{+path}","compare_url":"https://api.github.com/repos/Elgg/Elgg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Elgg/Elgg/merges","archive_url":"https://api.github.com/repos/Elgg/Elgg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Elgg/Elgg/downloads","issues_url":"https://api.github.com/repos/Elgg/Elgg/issues{/number}","pulls_url":"https://api.github.com/repos/Elgg/Elgg/pulls{/number}","milestones_url":"https://api.github.com/repos/Elgg/Elgg/milestones{/number}","notifications_url":"https://api.github.com/repos/Elgg/Elgg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Elgg/Elgg/labels{/name}","releases_url":"https://api.github.com/repos/Elgg/Elgg/releases{/id}","created_at":"2009-09-06T17:10:11Z","updated_at":"2015-08-13T14:05:04Z","pushed_at":"2015-08-15T04:17:22Z","git_url":"git://github.com/Elgg/Elgg.git","ssh_url":"git@github.com:Elgg/Elgg.git","clone_url":"https://github.com/Elgg/Elgg.git","svn_url":"https://github.com/Elgg/Elgg","homepage":"http://elgg.org","size":80803,"stargazers_count":758,"watchers_count":758,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":443,"mirror_url":null,"open_issues_count":800,"forks":443,"open_issues":800,"watchers":758,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/8778"},"html":{"href":"https://github.com/Elgg/Elgg/pull/8778"},"issue":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/8778"},"comments":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/8778/comments"},"review_comments":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/8778/comments"},"review_comment":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/8778/commits"},"statuses":{"href":"https://api.github.com/repos/Elgg/Elgg/statuses/5adf98fd83e6c15a6f417b63e02f1fb4f0c3fcb4"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"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},"comments":19,"review_comments":2,"commits":1,"additions":42,"deletions":7,"changed_files":3}}