{"action":"opened","number":7964,"pull_request":{"url":"https://api.github.com/repos/vanilla/vanilla/pulls/7964","id":225094377,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MDk0Mzc3","html_url":"https://github.com/vanilla/vanilla/pull/7964","diff_url":"https://github.com/vanilla/vanilla/pull/7964.diff","patch_url":"https://github.com/vanilla/vanilla/pull/7964.patch","issue_url":"https://api.github.com/repos/vanilla/vanilla/issues/7964","number":7964,"state":"open","locked":false,"title":"Add optional permissions field to /users/me API v2 endpoint response","user":{"login":"initvector","id":1390241,"node_id":"MDQ6VXNlcjEzOTAyNDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1390241?v=4","gravatar_id":"","url":"https://api.github.com/users/initvector","html_url":"https://github.com/initvector","followers_url":"https://api.github.com/users/initvector/followers","following_url":"https://api.github.com/users/initvector/following{/other_user}","gists_url":"https://api.github.com/users/initvector/gists{/gist_id}","starred_url":"https://api.github.com/users/initvector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/initvector/subscriptions","organizations_url":"https://api.github.com/users/initvector/orgs","repos_url":"https://api.github.com/users/initvector/repos","events_url":"https://api.github.com/users/initvector/events{/privacy}","received_events_url":"https://api.github.com/users/initvector/received_events","type":"User","site_admin":false},"body":"In an ongoing attempt to make Vanilla's API more accommodating to SPA's, this update introduces the ability to get the current user's permissions as an optional parameter on the /users/me API v2 endpoint. If the \"expand\" parameter is passed to this endpoint includes \"permissions\" (or \"all\"), the signed-in user or guest will have their permissions included as part of the response.\r\n\r\n### Changes\r\n\r\n1. `getPermissionFragment` has been added as a protected method on `AbstractApiController`. It is intended to represent a permission row in the \"new\" format.\r\n1. Rename `index_me` method on `UsersApiController` to `get_me`. This is a matter of semantics. An index in Vanilla's API means a list. A get is a single row. This change has no impact on functionality.\r\n1. Support for an \"expand\" query string parameter has been added to the /users/me endpoint. It currently supports one field: permissions. If a request is received with this value, the current user's permissions will be included in the response.\r\n1. The `getExpandDefinition` method of `ApiUtils` has been updated to always include the \"all\" value in expand definitions.\r\n1. `PermissionsTranslationTrait` has been updated with the `formatPermissions`, which will take a `Vanilla\\Permissions` object and return an array of permissions in the new scope-centric format. This format can currently be seen on the roles API endpoint. Essentially: each permission \"row\" has at least a type key, either \"global\" or a particular resource, and a permissions key, which contains an array of permissions relevant to that scope. There is also an optional id key, if a resource is specified (e.g. type equals \"category\" and id is a particular category ID). The primary difference to what will be seen in the users resource response, versus the roles response, is the users response will only return permissions a user has. The roles endpoint includes all permissions and indicates whether or not a particular role has them with a boolean flag. Since users only returns permissions the user has, the result has all permissions with a `true` for their boolean flag.\r\n\r\nCloses #7949","created_at":"2018-10-23T15:52:02Z","updated_at":"2018-10-23T15:52:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"charrondev","id":1770056,"node_id":"MDQ6VXNlcjE3NzAwNTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1770056?v=4","gravatar_id":"","url":"https://api.github.com/users/charrondev","html_url":"https://github.com/charrondev","followers_url":"https://api.github.com/users/charrondev/followers","following_url":"https://api.github.com/users/charrondev/following{/other_user}","gists_url":"https://api.github.com/users/charrondev/gists{/gist_id}","starred_url":"https://api.github.com/users/charrondev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charrondev/subscriptions","organizations_url":"https://api.github.com/users/charrondev/orgs","repos_url":"https://api.github.com/users/charrondev/repos","events_url":"https://api.github.com/users/charrondev/events{/privacy}","received_events_url":"https://api.github.com/users/charrondev/received_events","type":"User","site_admin":false},"assignees":[{"login":"charrondev","id":1770056,"node_id":"MDQ6VXNlcjE3NzAwNTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1770056?v=4","gravatar_id":"","url":"https://api.github.com/users/charrondev","html_url":"https://github.com/charrondev","followers_url":"https://api.github.com/users/charrondev/followers","following_url":"https://api.github.com/users/charrondev/following{/other_user}","gists_url":"https://api.github.com/users/charrondev/gists{/gist_id}","starred_url":"https://api.github.com/users/charrondev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charrondev/subscriptions","organizations_url":"https://api.github.com/users/charrondev/orgs","repos_url":"https://api.github.com/users/charrondev/repos","events_url":"https://api.github.com/users/charrondev/events{/privacy}","received_events_url":"https://api.github.com/users/charrondev/received_events","type":"User","site_admin":false},{"login":"slafleche","id":19651440,"node_id":"MDQ6VXNlcjE5NjUxNDQw","avatar_url":"https://avatars1.githubusercontent.com/u/19651440?v=4","gravatar_id":"","url":"https://api.github.com/users/slafleche","html_url":"https://github.com/slafleche","followers_url":"https://api.github.com/users/slafleche/followers","following_url":"https://api.github.com/users/slafleche/following{/other_user}","gists_url":"https://api.github.com/users/slafleche/gists{/gist_id}","starred_url":"https://api.github.com/users/slafleche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slafleche/subscriptions","organizations_url":"https://api.github.com/users/slafleche/orgs","repos_url":"https://api.github.com/users/slafleche/repos","events_url":"https://api.github.com/users/slafleche/events{/privacy}","received_events_url":"https://api.github.com/users/slafleche/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/vanilla/vanilla/milestones/90","html_url":"https://github.com/vanilla/vanilla/milestone/90","labels_url":"https://api.github.com/repos/vanilla/vanilla/milestones/90/labels","id":3626191,"node_id":"MDk6TWlsZXN0b25lMzYyNjE5MQ==","number":90,"title":"2018-10-31","description":"","creator":{"login":"linc","id":117672,"node_id":"MDQ6VXNlcjExNzY3Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/117672?v=4","gravatar_id":"","url":"https://api.github.com/users/linc","html_url":"https://github.com/linc","followers_url":"https://api.github.com/users/linc/followers","following_url":"https://api.github.com/users/linc/following{/other_user}","gists_url":"https://api.github.com/users/linc/gists{/gist_id}","starred_url":"https://api.github.com/users/linc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linc/subscriptions","organizations_url":"https://api.github.com/users/linc/orgs","repos_url":"https://api.github.com/users/linc/repos","events_url":"https://api.github.com/users/linc/events{/privacy}","received_events_url":"https://api.github.com/users/linc/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":1,"state":"open","created_at":"2018-09-05T18:09:35Z","updated_at":"2018-10-23T15:52:02Z","due_on":"2018-10-31T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/vanilla/vanilla/pulls/7964/commits","review_comments_url":"https://api.github.com/repos/vanilla/vanilla/pulls/7964/comments","review_comment_url":"https://api.github.com/repos/vanilla/vanilla/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vanilla/vanilla/issues/7964/comments","statuses_url":"https://api.github.com/repos/vanilla/vanilla/statuses/0f10284cf7e43d3d896f254018a8eb3e170db97d","head":{"label":"vanilla:feature/api-me-permissions","ref":"feature/api-me-permissions","sha":"0f10284cf7e43d3d896f254018a8eb3e170db97d","user":{"login":"vanilla","id":7443552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NDM1NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/7443552?v=4","gravatar_id":"","url":"https://api.github.com/users/vanilla","html_url":"https://github.com/vanilla","followers_url":"https://api.github.com/users/vanilla/followers","following_url":"https://api.github.com/users/vanilla/following{/other_user}","gists_url":"https://api.github.com/users/vanilla/gists{/gist_id}","starred_url":"https://api.github.com/users/vanilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanilla/subscriptions","organizations_url":"https://api.github.com/users/vanilla/orgs","repos_url":"https://api.github.com/users/vanilla/repos","events_url":"https://api.github.com/users/vanilla/events{/privacy}","received_events_url":"https://api.github.com/users/vanilla/received_events","type":"Organization","site_admin":false},"repo":{"id":232390,"node_id":"MDEwOlJlcG9zaXRvcnkyMzIzOTA=","name":"vanilla","full_name":"vanilla/vanilla","private":false,"owner":{"login":"vanilla","id":7443552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NDM1NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/7443552?v=4","gravatar_id":"","url":"https://api.github.com/users/vanilla","html_url":"https://github.com/vanilla","followers_url":"https://api.github.com/users/vanilla/followers","following_url":"https://api.github.com/users/vanilla/following{/other_user}","gists_url":"https://api.github.com/users/vanilla/gists{/gist_id}","starred_url":"https://api.github.com/users/vanilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanilla/subscriptions","organizations_url":"https://api.github.com/users/vanilla/orgs","repos_url":"https://api.github.com/users/vanilla/repos","events_url":"https://api.github.com/users/vanilla/events{/privacy}","received_events_url":"https://api.github.com/users/vanilla/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vanilla/vanilla","description":"Vanilla is a powerfully simple discussion forum you can easily customize to make as unique as your community.","fork":false,"url":"https://api.github.com/repos/vanilla/vanilla","forks_url":"https://api.github.com/repos/vanilla/vanilla/forks","keys_url":"https://api.github.com/repos/vanilla/vanilla/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vanilla/vanilla/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vanilla/vanilla/teams","hooks_url":"https://api.github.com/repos/vanilla/vanilla/hooks","issue_events_url":"https://api.github.com/repos/vanilla/vanilla/issues/events{/number}","events_url":"https://api.github.com/repos/vanilla/vanilla/events","assignees_url":"https://api.github.com/repos/vanilla/vanilla/assignees{/user}","branches_url":"https://api.github.com/repos/vanilla/vanilla/branches{/branch}","tags_url":"https://api.github.com/repos/vanilla/vanilla/tags","blobs_url":"https://api.github.com/repos/vanilla/vanilla/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vanilla/vanilla/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vanilla/vanilla/git/refs{/sha}","trees_url":"https://api.github.com/repos/vanilla/vanilla/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vanilla/vanilla/statuses/{sha}","languages_url":"https://api.github.com/repos/vanilla/vanilla/languages","stargazers_url":"https://api.github.com/repos/vanilla/vanilla/stargazers","contributors_url":"https://api.github.com/repos/vanilla/vanilla/contributors","subscribers_url":"https://api.github.com/repos/vanilla/vanilla/subscribers","subscription_url":"https://api.github.com/repos/vanilla/vanilla/subscription","commits_url":"https://api.github.com/repos/vanilla/vanilla/commits{/sha}","git_commits_url":"https://api.github.com/repos/vanilla/vanilla/git/commits{/sha}","comments_url":"https://api.github.com/repos/vanilla/vanilla/comments{/number}","issue_comment_url":"https://api.github.com/repos/vanilla/vanilla/issues/comments{/number}","contents_url":"https://api.github.com/repos/vanilla/vanilla/contents/{+path}","compare_url":"https://api.github.com/repos/vanilla/vanilla/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vanilla/vanilla/merges","archive_url":"https://api.github.com/repos/vanilla/vanilla/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vanilla/vanilla/downloads","issues_url":"https://api.github.com/repos/vanilla/vanilla/issues{/number}","pulls_url":"https://api.github.com/repos/vanilla/vanilla/pulls{/number}","milestones_url":"https://api.github.com/repos/vanilla/vanilla/milestones{/number}","notifications_url":"https://api.github.com/repos/vanilla/vanilla/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vanilla/vanilla/labels{/name}","releases_url":"https://api.github.com/repos/vanilla/vanilla/releases{/id}","deployments_url":"https://api.github.com/repos/vanilla/vanilla/deployments","created_at":"2009-06-21T01:41:25Z","updated_at":"2018-10-22T20:29:45Z","pushed_at":"2018-10-23T15:39:27Z","git_url":"git://github.com/vanilla/vanilla.git","ssh_url":"git@github.com:vanilla/vanilla.git","clone_url":"https://github.com/vanilla/vanilla.git","svn_url":"https://github.com/vanilla/vanilla","homepage":"https://open.vanillaforums.com","size":97121,"stargazers_count":1854,"watchers_count":1854,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":654,"mirror_url":null,"archived":false,"open_issues_count":683,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":654,"open_issues":683,"watchers":1854,"default_branch":"master"}},"base":{"label":"vanilla:master","ref":"master","sha":"062bf92e97b80a77751e025f322fc33c7fbfdf67","user":{"login":"vanilla","id":7443552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NDM1NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/7443552?v=4","gravatar_id":"","url":"https://api.github.com/users/vanilla","html_url":"https://github.com/vanilla","followers_url":"https://api.github.com/users/vanilla/followers","following_url":"https://api.github.com/users/vanilla/following{/other_user}","gists_url":"https://api.github.com/users/vanilla/gists{/gist_id}","starred_url":"https://api.github.com/users/vanilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanilla/subscriptions","organizations_url":"https://api.github.com/users/vanilla/orgs","repos_url":"https://api.github.com/users/vanilla/repos","events_url":"https://api.github.com/users/vanilla/events{/privacy}","received_events_url":"https://api.github.com/users/vanilla/received_events","type":"Organization","site_admin":false},"repo":{"id":232390,"node_id":"MDEwOlJlcG9zaXRvcnkyMzIzOTA=","name":"vanilla","full_name":"vanilla/vanilla","private":false,"owner":{"login":"vanilla","id":7443552,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NDM1NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/7443552?v=4","gravatar_id":"","url":"https://api.github.com/users/vanilla","html_url":"https://github.com/vanilla","followers_url":"https://api.github.com/users/vanilla/followers","following_url":"https://api.github.com/users/vanilla/following{/other_user}","gists_url":"https://api.github.com/users/vanilla/gists{/gist_id}","starred_url":"https://api.github.com/users/vanilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanilla/subscriptions","organizations_url":"https://api.github.com/users/vanilla/orgs","repos_url":"https://api.github.com/users/vanilla/repos","events_url":"https://api.github.com/users/vanilla/events{/privacy}","received_events_url":"https://api.github.com/users/vanilla/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vanilla/vanilla","description":"Vanilla is a powerfully simple discussion forum you can easily customize to make as unique as your community.","fork":false,"url":"https://api.github.com/repos/vanilla/vanilla","forks_url":"https://api.github.com/repos/vanilla/vanilla/forks","keys_url":"https://api.github.com/repos/vanilla/vanilla/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vanilla/vanilla/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vanilla/vanilla/teams","hooks_url":"https://api.github.com/repos/vanilla/vanilla/hooks","issue_events_url":"https://api.github.com/repos/vanilla/vanilla/issues/events{/number}","events_url":"https://api.github.com/repos/vanilla/vanilla/events","assignees_url":"https://api.github.com/repos/vanilla/vanilla/assignees{/user}","branches_url":"https://api.github.com/repos/vanilla/vanilla/branches{/branch}","tags_url":"https://api.github.com/repos/vanilla/vanilla/tags","blobs_url":"https://api.github.com/repos/vanilla/vanilla/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vanilla/vanilla/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vanilla/vanilla/git/refs{/sha}","trees_url":"https://api.github.com/repos/vanilla/vanilla/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vanilla/vanilla/statuses/{sha}","languages_url":"https://api.github.com/repos/vanilla/vanilla/languages","stargazers_url":"https://api.github.com/repos/vanilla/vanilla/stargazers","contributors_url":"https://api.github.com/repos/vanilla/vanilla/contributors","subscribers_url":"https://api.github.com/repos/vanilla/vanilla/subscribers","subscription_url":"https://api.github.com/repos/vanilla/vanilla/subscription","commits_url":"https://api.github.com/repos/vanilla/vanilla/commits{/sha}","git_commits_url":"https://api.github.com/repos/vanilla/vanilla/git/commits{/sha}","comments_url":"https://api.github.com/repos/vanilla/vanilla/comments{/number}","issue_comment_url":"https://api.github.com/repos/vanilla/vanilla/issues/comments{/number}","contents_url":"https://api.github.com/repos/vanilla/vanilla/contents/{+path}","compare_url":"https://api.github.com/repos/vanilla/vanilla/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vanilla/vanilla/merges","archive_url":"https://api.github.com/repos/vanilla/vanilla/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vanilla/vanilla/downloads","issues_url":"https://api.github.com/repos/vanilla/vanilla/issues{/number}","pulls_url":"https://api.github.com/repos/vanilla/vanilla/pulls{/number}","milestones_url":"https://api.github.com/repos/vanilla/vanilla/milestones{/number}","notifications_url":"https://api.github.com/repos/vanilla/vanilla/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vanilla/vanilla/labels{/name}","releases_url":"https://api.github.com/repos/vanilla/vanilla/releases{/id}","deployments_url":"https://api.github.com/repos/vanilla/vanilla/deployments","created_at":"2009-06-21T01:41:25Z","updated_at":"2018-10-22T20:29:45Z","pushed_at":"2018-10-23T15:39:27Z","git_url":"git://github.com/vanilla/vanilla.git","ssh_url":"git@github.com:vanilla/vanilla.git","clone_url":"https://github.com/vanilla/vanilla.git","svn_url":"https://github.com/vanilla/vanilla","homepage":"https://open.vanillaforums.com","size":97121,"stargazers_count":1854,"watchers_count":1854,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":654,"mirror_url":null,"archived":false,"open_issues_count":683,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":654,"open_issues":683,"watchers":1854,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vanilla/vanilla/pulls/7964"},"html":{"href":"https://github.com/vanilla/vanilla/pull/7964"},"issue":{"href":"https://api.github.com/repos/vanilla/vanilla/issues/7964"},"comments":{"href":"https://api.github.com/repos/vanilla/vanilla/issues/7964/comments"},"review_comments":{"href":"https://api.github.com/repos/vanilla/vanilla/pulls/7964/comments"},"review_comment":{"href":"https://api.github.com/repos/vanilla/vanilla/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vanilla/vanilla/pulls/7964/commits"},"statuses":{"href":"https://api.github.com/repos/vanilla/vanilla/statuses/0f10284cf7e43d3d896f254018a8eb3e170db97d"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":4,"additions":129,"deletions":4,"changed_files":4}}
{"actor":{"display_login":"initvector"}}