{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6285","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6285/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6285/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6285/events","html_url":"https://github.com/Automattic/wp-calypso/pull/6285","id":162047215,"number":6285,"title":"Sites: filter site if user has no capabilities","user":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Sites","name":"Sites","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"assignees":[{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/89","html_url":"https://github.com/Automattic/wp-calypso/milestones/Plans:%20Maintenance","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/89/labels","id":1768456,"number":89,"title":"Plans: Maintenance","description":"","creator":{"login":"fabianapsimoes","id":1248436,"avatar_url":"https://avatars.githubusercontent.com/u/1248436?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianapsimoes","html_url":"https://github.com/fabianapsimoes","followers_url":"https://api.github.com/users/fabianapsimoes/followers","following_url":"https://api.github.com/users/fabianapsimoes/following{/other_user}","gists_url":"https://api.github.com/users/fabianapsimoes/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianapsimoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianapsimoes/subscriptions","organizations_url":"https://api.github.com/users/fabianapsimoes/orgs","repos_url":"https://api.github.com/users/fabianapsimoes/repos","events_url":"https://api.github.com/users/fabianapsimoes/events{/privacy}","received_events_url":"https://api.github.com/users/fabianapsimoes/received_events","type":"User","site_admin":false},"open_issues":38,"closed_issues":44,"state":"open","created_at":"2016-05-16T10:50:24Z","updated_at":"2016-06-24T19:10:12Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-06-23T23:41:33Z","updated_at":"2016-06-24T19:32:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6285","html_url":"https://github.com/Automattic/wp-calypso/pull/6285","diff_url":"https://github.com/Automattic/wp-calypso/pull/6285.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/6285.patch"},"body":"This PR addresses some of the odd behavior seen in #6276, where a user with a \"None\" role will still see a site in the sites list, even when they have no permissions to modify anything on the site.\r\n\r\nI would prefer fixing this in the API, but I'm not sure what functionality this would break if we altered the visible sites list to not include a site if they have no capabilities. The alternative is this PR which filters this on the client. It isn't perfect since the site count will conflict for a brief moment with information on the user object.\r\n\r\n## Testing Instructions\r\n- Add a test user to your site with the \"None\" role\r\n- Login as that user\r\n- The user should not see your site in their sites list\r\n\r\ncc @rralian @lamosty @gravityrail @aduth \n\nTest live: https://calypso.live/?branch=fix/sites-filter-capabilities"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/228440407","html_url":"https://github.com/Automattic/wp-calypso/pull/6285#issuecomment-228440407","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6285","id":228440407,"user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T19:32:14Z","updated_at":"2016-06-24T19:32:14Z","body":"Hmm, I'm not very clear on the purpose of the \"None\" role, but what distinction is there between \"None\" and not being a user of the site, if not for the site appearing in the user's account?"}}
{"actor":{"display_login":"aduth"}}