{"action":"created","issue":{"url":"https://api.github.com/repos/rancherio/rancher/issues/1127","labels_url":"https://api.github.com/repos/rancherio/rancher/issues/1127/labels{/name}","comments_url":"https://api.github.com/repos/rancherio/rancher/issues/1127/comments","events_url":"https://api.github.com/repos/rancherio/rancher/issues/1127/events","html_url":"https://github.com/rancherio/rancher/issues/1127","id":86798431,"number":1127,"title":"Attempting to access resources from a project that user does not have access to should result in API failing with \"Unauthorized\" error code.","user":{"login":"sangeethah","id":4266958,"avatar_url":"https://avatars.githubusercontent.com/u/4266958?v=3","gravatar_id":"","url":"https://api.github.com/users/sangeethah","html_url":"https://github.com/sangeethah","followers_url":"https://api.github.com/users/sangeethah/followers","following_url":"https://api.github.com/users/sangeethah/following{/other_user}","gists_url":"https://api.github.com/users/sangeethah/gists{/gist_id}","starred_url":"https://api.github.com/users/sangeethah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sangeethah/subscriptions","organizations_url":"https://api.github.com/users/sangeethah/orgs","repos_url":"https://api.github.com/users/sangeethah/repos","events_url":"https://api.github.com/users/sangeethah/events{/privacy}","received_events_url":"https://api.github.com/users/sangeethah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rancherio/rancher/labels/area/environment","name":"area/environment","color":"FBCA04"},{"url":"https://api.github.com/repos/rancherio/rancher/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/rancherio/rancher/labels/status/reopened","name":"status/reopened","color":"C80408"}],"state":"open","locked":false,"assignee":{"login":"hibooboo2","id":1197823,"avatar_url":"https://avatars.githubusercontent.com/u/1197823?v=3","gravatar_id":"","url":"https://api.github.com/users/hibooboo2","html_url":"https://github.com/hibooboo2","followers_url":"https://api.github.com/users/hibooboo2/followers","following_url":"https://api.github.com/users/hibooboo2/following{/other_user}","gists_url":"https://api.github.com/users/hibooboo2/gists{/gist_id}","starred_url":"https://api.github.com/users/hibooboo2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hibooboo2/subscriptions","organizations_url":"https://api.github.com/users/hibooboo2/orgs","repos_url":"https://api.github.com/users/hibooboo2/repos","events_url":"https://api.github.com/users/hibooboo2/events{/privacy}","received_events_url":"https://api.github.com/users/hibooboo2/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/rancherio/rancher/milestones/4","html_url":"https://github.com/rancherio/rancher/milestones/Release%201.0","labels_url":"https://api.github.com/repos/rancherio/rancher/milestones/4/labels","id":947265,"number":4,"title":"Release 1.0","description":"MVP for Rancher 1.0","creator":{"login":"will-chan","id":10134676,"avatar_url":"https://avatars.githubusercontent.com/u/10134676?v=3","gravatar_id":"","url":"https://api.github.com/users/will-chan","html_url":"https://github.com/will-chan","followers_url":"https://api.github.com/users/will-chan/followers","following_url":"https://api.github.com/users/will-chan/following{/other_user}","gists_url":"https://api.github.com/users/will-chan/gists{/gist_id}","starred_url":"https://api.github.com/users/will-chan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-chan/subscriptions","organizations_url":"https://api.github.com/users/will-chan/orgs","repos_url":"https://api.github.com/users/will-chan/repos","events_url":"https://api.github.com/users/will-chan/events{/privacy}","received_events_url":"https://api.github.com/users/will-chan/received_events","type":"User","site_admin":false},"open_issues":156,"closed_issues":34,"state":"open","created_at":"2015-01-22T18:32:24Z","updated_at":"2015-06-12T05:23:12Z","due_on":"2015-08-26T07:00:00Z","closed_at":null},"comments":3,"created_at":"2015-06-10T01:48:43Z","updated_at":"2015-06-12T06:54:04Z","closed_at":null,"body":"Server version - build from master jun/09\r\n\r\nGithub user test1 belongs to github group - g1.\r\n\r\nAdd g1 as member to Default environment.\r\nCreate env1. \r\nCreate env2 and add g1 as member.\r\n\r\nCreate API keys for a github user account - test1.\r\n\r\nUsing this apikey , try to access project ev1( which user has no access to) using  /v1/projects/env1id. \r\nAPI returns 404 \r\n{\r\n\"id\": \"88ad188a-e302-4117-a66e-185923ac8ca0\",\r\n\"type\": \"error\",\r\n\"links\": { },\r\n\"actions\": { },\r\n\"status\": 404,\r\n\"code\": \"Not Found\",\r\n\"message\": \"Not Found\",\r\n\"detail\": null,\r\n}\r\nUsing this apikey , try to access any resource from project env1 using /v1/projects/env1id/containers.\r\nAPI returns 500 Internal server error:\r\n\r\n{\r\n\"id\": \"4eb14925-f0f2-4291-8258-21f32a71998e\",\r\n\"type\": \"error\",\r\n\"links\": { },\r\n\"actions\": { },\r\n\"status\": 500,\r\n\"code\": \"Internal Server Error\",\r\n\"message\": \"Internal Server Error\",\r\n\"detail\": null,\r\n} \r\n"},"comment":{"url":"https://api.github.com/repos/rancherio/rancher/issues/comments/111383433","html_url":"https://github.com/rancherio/rancher/issues/1127#issuecomment-111383433","issue_url":"https://api.github.com/repos/rancherio/rancher/issues/1127","id":111383433,"user":{"login":"vincent99","id":753917,"avatar_url":"https://avatars.githubusercontent.com/u/753917?v=3","gravatar_id":"","url":"https://api.github.com/users/vincent99","html_url":"https://github.com/vincent99","followers_url":"https://api.github.com/users/vincent99/followers","following_url":"https://api.github.com/users/vincent99/following{/other_user}","gists_url":"https://api.github.com/users/vincent99/gists{/gist_id}","starred_url":"https://api.github.com/users/vincent99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincent99/subscriptions","organizations_url":"https://api.github.com/users/vincent99/orgs","repos_url":"https://api.github.com/users/vincent99/repos","events_url":"https://api.github.com/users/vincent99/events{/privacy}","received_events_url":"https://api.github.com/users/vincent99/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T06:54:04Z","updated_at":"2015-06-12T06:54:04Z","body":"Either 404 or 403 would be fine here, but it should be consistent.\r\n\r\nThe more important thing to check is that you get the same error response whether the request is for an actual or non-existent collection name, resource id, filter/include/sort/pagination params, etc.  Not a slightly different response if that id actually exists vs it doesn't.  There probably shouldn't be more than one spot in the code that handles this."}}