{"action":"opened","number":14684,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/14684","id":111265218,"html_url":"https://github.com/joomla/joomla-cms/pull/14684","diff_url":"https://github.com/joomla/joomla-cms/pull/14684.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/14684.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/14684","number":14684,"state":"open","locked":false,"title":"[com_fields] Only allow super admins to create a SQL custom field","user":{"login":"laoneo","id":251072,"avatar_url":"https://avatars0.githubusercontent.com/u/251072?v=3","gravatar_id":"","url":"https://api.github.com/users/laoneo","html_url":"https://github.com/laoneo","followers_url":"https://api.github.com/users/laoneo/followers","following_url":"https://api.github.com/users/laoneo/following{/other_user}","gists_url":"https://api.github.com/users/laoneo/gists{/gist_id}","starred_url":"https://api.github.com/users/laoneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laoneo/subscriptions","organizations_url":"https://api.github.com/users/laoneo/orgs","repos_url":"https://api.github.com/users/laoneo/repos","events_url":"https://api.github.com/users/laoneo/events{/privacy}","received_events_url":"https://api.github.com/users/laoneo/received_events","type":"User","site_admin":false},"body":"### Summary of Changes\r\nThe issue with the SQL field is that it can be risky when none super admins can edit it and define the SQL query setting. This query will be then executed on every article edit or view access. Like that it will be possible to define update queries which can be abused to grant super admin privileges to none super admins.\r\n\r\nThis PR changes the behavior of the SQL field, that only Super Admins can create it.  Additionally it sets the \"Edit\" permission for all none Super Admin groups to deny. Means the super admin must explicitly allow none super admin groups to edit the field.\r\n\r\nI would like to thank @yvesh and @SniperSister for their help on that.\r\n\r\n\r\n### Testing Instructions\r\n1. Create a new SQL custom field as none super admin.\r\n2. Create a new SQL field as super admin.\r\n3. Create a new SQL field as super admin and set the Administrator Group to \"Allow\".\r\n\r\n\r\n### Expected result\r\n1. An error is shown and the field is not saved.\r\n2. The \"Public\" group must have the \"Deny\" flag set for the edit permission. All other groups must inherit that flag and it should not being allowed to edit the field. A warning is shown that the permissions got updated automatically.\r\n3. The Administrator group should have the Allow permission.\r\n\r\n\r\n### Actual result\r\n1. No erro is shown. The field got created.\r\n2. No warning is shown. The field got created and the permissions not automatically adjusted.\r\n3. The Administrator group should have the Allow permission.\r\n\r\n\r\n### Documentation Changes Required\r\nFor the SQL custom field the behavior must be explained in the documentation.\r\n","created_at":"2017-03-17T11:49:31Z","updated_at":"2017-03-17T11:49:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/14684/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/14684/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/14684/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/d7ccf6e33d644c335928a6f5fa99c592a9065b83","head":{"label":"Digital-Peak:cf/sql-plugin","ref":"cf/sql-plugin","sha":"d7ccf6e33d644c335928a6f5fa99c592a9065b83","user":{"login":"Digital-Peak","id":4374265,"avatar_url":"https://avatars2.githubusercontent.com/u/4374265?v=3","gravatar_id":"","url":"https://api.github.com/users/Digital-Peak","html_url":"https://github.com/Digital-Peak","followers_url":"https://api.github.com/users/Digital-Peak/followers","following_url":"https://api.github.com/users/Digital-Peak/following{/other_user}","gists_url":"https://api.github.com/users/Digital-Peak/gists{/gist_id}","starred_url":"https://api.github.com/users/Digital-Peak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digital-Peak/subscriptions","organizations_url":"https://api.github.com/users/Digital-Peak/orgs","repos_url":"https://api.github.com/users/Digital-Peak/repos","events_url":"https://api.github.com/users/Digital-Peak/events{/privacy}","received_events_url":"https://api.github.com/users/Digital-Peak/received_events","type":"Organization","site_admin":false},"repo":{"id":41362268,"name":"joomla-cms","full_name":"Digital-Peak/joomla-cms","owner":{"login":"Digital-Peak","id":4374265,"avatar_url":"https://avatars2.githubusercontent.com/u/4374265?v=3","gravatar_id":"","url":"https://api.github.com/users/Digital-Peak","html_url":"https://github.com/Digital-Peak","followers_url":"https://api.github.com/users/Digital-Peak/followers","following_url":"https://api.github.com/users/Digital-Peak/following{/other_user}","gists_url":"https://api.github.com/users/Digital-Peak/gists{/gist_id}","starred_url":"https://api.github.com/users/Digital-Peak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digital-Peak/subscriptions","organizations_url":"https://api.github.com/users/Digital-Peak/orgs","repos_url":"https://api.github.com/users/Digital-Peak/repos","events_url":"https://api.github.com/users/Digital-Peak/events{/privacy}","received_events_url":"https://api.github.com/users/Digital-Peak/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Digital-Peak/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/Digital-Peak/joomla-cms","forks_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/forks","keys_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/teams","hooks_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/events","assignees_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/tags","blobs_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/subscription","commits_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/merges","archive_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/downloads","issues_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/Digital-Peak/joomla-cms/deployments","created_at":"2015-08-25T12:34:04Z","updated_at":"2016-02-17T12:01:34Z","pushed_at":"2017-03-17T10:27:47Z","git_url":"git://github.com/Digital-Peak/joomla-cms.git","ssh_url":"git@github.com:Digital-Peak/joomla-cms.git","clone_url":"https://github.com/Digital-Peak/joomla-cms.git","svn_url":"https://github.com/Digital-Peak/joomla-cms","homepage":"http://joomla.org","size":184392,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"6d94b8eea6106f298c02eb43a6096f2b99e85005","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars0.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://avatars0.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":"2017-03-17T08:48:59Z","pushed_at":"2017-03-17T10:48:26Z","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":184480,"stargazers_count":2290,"watchers_count":2290,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2431,"mirror_url":null,"open_issues_count":758,"forks":2431,"open_issues":758,"watchers":2290,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/14684"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/14684"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/14684"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/14684/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/14684/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/14684/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/d7ccf6e33d644c335928a6f5fa99c592a9065b83"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":45,"deletions":0,"changed_files":3}}
{"actor":{"display_login":"laoneo"}}