{"action":"opened","number":10894,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/10894","id":74633410,"html_url":"https://github.com/joomla/joomla-cms/pull/10894","diff_url":"https://github.com/joomla/joomla-cms/pull/10894.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/10894.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10894","number":10894,"state":"open","locked":false,"title":"[ACL] Don't explicit use the parent asset permissions on creating a new item + other issues","user":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"body":"Pull Request for Several ACL Issues (part 2).\r\n\r\n#### Summary of Changes\r\n\r\nWhat this PR does:\r\n- Displays the correct calculated permissions in item <-> section(s) <-> component <-> global config scenario.\r\n- Stop explicit writing the parent asset permissions on creating a new item (module, article, etc). Now all are create with Inhrited in all groups/actions so they Inhrited them.\r\n- On create a new item (module, article, etc) and not saving the Permmission tab calculated are now the component ones.\r\n- Further simplifies the ACL rules code to make it more undertstandable.\r\n- Solves some other minor bugs.\r\n\r\nTo get the explicit item ACL permission in a item <-> section(s) <-> component <-> global config scenario i had to change JAccess::getAssetRules() behaviour.\r\n\r\n**Mantainers** before merging please confirm this is correct and will not have side effects.\r\n\r\n\r\n###### Information: ACL Inheritance Scenarios\r\n\r\nThere are four ACL Asset Inheritance scenarios:\r\n\r\n- item <-> section(s) <-> component <-> global config (ex: article <-> category <-> com_content <-> global config)\r\n- item <-> component <-> global config (ex: category <-> com_content <-> global config)\r\n- component <-> global config (ex: com_content <-> global config)\r\n- global config\r\n\r\nBesides inheriting from the asset(s), ACL also inherits from parent User Group(s).\r\n\r\n**Mantainers** please confirm this are the scenarios at play.\r\n\r\n#### Testing Instructions\r\n\r\n###### Pre-requisites\r\n\r\nUse latest staging.\r\nClean install.\r\n\r\n###### Test 1: Testing default ACL Inheritance on creating a new iitem\r\n\r\nThis tests creating a new item without explicit inhreting permissions\r\n- Create a new category \"Test ACL\" category, don't change anything and save\r\n- Edit the category\r\n- Check category permissions are inhreited form com_config + com_content\r\n- Check there is no explict \"Allowed\" or \"Denied\" permission.\r\n- Change one permission to \"Denied\" and exit\r\n- Now create a new article assign to \"Test ACL\" category, don't change anything and save\r\n- Now edit the article\r\n- Check the com_config + com_content + category permissions are all inhrited as they should.\r\n- Check there is no explict \"Allowed\" or \"Denied\" permission.\r\n\r\nNote: You can also check that before the patch the item(s) have explicity \"Allowed\" or \"Denied\" permission on create.\r\n\r\n###### Test 2: Testing ACL asset/groups Inheritance\r\n\r\nThis test should be made in sequence.\r\n\r\n1: This tests Global config child groups Inherit\r\n\r\n- Go to Global config\r\n- Change Public \"Delete\" to Denied\r\n- Change Public \"Edit\" to Allowed\r\n- Refresh the page.\r\n- Change Registered \"Edit state\" to Denied\r\n- Change Registered \"Edit Own\" to Allowed\r\n- Refresh the page\r\n- Check all Global config Permissions are all inhrited as they should.\r\n\r\n2: This tests Global config -> Component Inherit\r\n\r\n- Go to Articles (com_content) Config \r\n- Check the com_config permission are all inhrited as they should.\r\n- Change Author \"Edit Own\" to Denied\r\n- Refresh the page\r\n- Check the child groups permissions are all inhrited as they should.\r\n\r\n3: This tests Global config -> Component -> Item Inherit\r\n\r\n- Create new category, name it \"Test ACL\" don't change anything and save\r\n- Now edit the category\r\n- Check the com_config + com_content permissions are all inhrited as they should.\r\n- Change Editor \"Edit\" to Denied\r\n- Refresh the page\r\n- Check the child groups  permissions are all inhrited as they should.\r\n\r\n4: This tests Global config -> Component -> Extension -> Item Inherit\r\n\r\n- Create a new article assign to \"Test ACL\" category, don't change anything and save\r\n- Now edit the article\r\n- Check the com_config + com_content + category permissions are all inhrited as they should.\r\n- Change Manager \"Edit\" to Denied\r\n- Refresh the page\r\n- Check the child groups  permissions are all inhrited as they should.\r\n\r\n#### Still known issues (that will not be solved by this PR)\r\n\r\n1: When creating a new item (not saving) it uses the calculated permissions from the component (item <-> component <-> global config).\r\nBut if we have a section too (item <-> section(s) <-> component <-> global config) this is not correct.\r\nThis is a **incorrect info bug**.\r\n\r\n2: In \"1:\", it uses the component permission, but should use the calculated permissions for achild of the component/section.\r\nThis is a **incorrect info bug**.\r\n\r\n3: If a component as a permission that doesn't exists in global config (ex: frontend editing in com_modules) by default we get \"Not Allowed (Inherited)\" when we should get \"Not Allowed (Default)\".\r\nIn resume, if doesn't exist in the parent asset it can't Inherit from it.\r\nThis is a **incorrect info bug**.\r\n\r\n4: When changing a permission of an item that doesn't have a row in the asset table the row a new row is created.\r\nThis works fine for item <-> component <-> global config scenario and component <-> global config scenario.\r\nBut doesn't work properly for item <-> section(s) <-> component <-> global config scenario because a wrong parent asset id (the component) is stored.\r\nThis is a **incorrect ACL bug**, happens when there is no row in the asset table (ex: deleted or not created on update).\r\n\r\nNote: This known issues are marked in comments as todo in the code.\r\n\r\n@infograf768 @roland-d thanks for all your help on checking this.\r\nAnd please check.","created_at":"2016-06-21T15:28:55Z","updated_at":"2016-06-21T15:28:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/10894/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/10894/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10894/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/d20a4c8853be1955917e37009ba1bd85ef2b9bee","head":{"label":"andrepereiradasilva:ac-part-2","ref":"ac-part-2","sha":"d20a4c8853be1955917e37009ba1bd85ef2b9bee","user":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"repo":{"id":46170295,"name":"joomla-cms","full_name":"andrepereiradasilva/joomla-cms","owner":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrepereiradasilva/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms","forks_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/forks","keys_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/teams","hooks_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/events","assignees_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/tags","blobs_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/subscription","commits_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/merges","archive_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/downloads","issues_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/deployments","created_at":"2015-11-14T10:22:32Z","updated_at":"2016-03-03T00:12:42Z","pushed_at":"2016-06-21T12:50:21Z","git_url":"git://github.com/andrepereiradasilva/joomla-cms.git","ssh_url":"git@github.com:andrepereiradasilva/joomla-cms.git","clone_url":"https://github.com/andrepereiradasilva/joomla-cms.git","svn_url":"https://github.com/andrepereiradasilva/joomla-cms","homepage":"https://www.joomla.org","size":150093,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":0,"default_branch":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"9e596d1e2cb679316e54e6d3a3e8dad22fb11fe9","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"name":"joomla-cms","full_name":"joomla/joomla-cms","owner":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/joomla/joomla-cms/deployments","created_at":"2011-09-27T02:07:38Z","updated_at":"2016-06-20T22:48:26Z","pushed_at":"2016-06-21T13:24:42Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"https://www.joomla.org","size":280925,"stargazers_count":2038,"watchers_count":2038,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2197,"mirror_url":null,"open_issues_count":475,"forks":2197,"open_issues":475,"watchers":2038,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/10894"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/10894"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/10894"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/10894/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/10894/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/10894/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/d20a4c8853be1955917e37009ba1bd85ef2b9bee"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":26,"additions":110,"deletions":66,"changed_files":3}}
{"actor":{"display_login":"andrepereiradasilva"}}