{"action":"created","issue":{"url":"https://api.github.com/repos/hasura/graphql-engine/issues/877","repository_url":"https://api.github.com/repos/hasura/graphql-engine","labels_url":"https://api.github.com/repos/hasura/graphql-engine/issues/877/labels{/name}","comments_url":"https://api.github.com/repos/hasura/graphql-engine/issues/877/comments","events_url":"https://api.github.com/repos/hasura/graphql-engine/issues/877/events","html_url":"https://github.com/hasura/graphql-engine/issues/877","id":374593179,"node_id":"MDU6SXNzdWUzNzQ1OTMxNzk=","number":877,"title":"Support x-hasura-roles in headers instead of x-hasura-role","user":{"login":"revskill10","id":1390196,"node_id":"MDQ6VXNlcjEzOTAxOTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1390196?v=4","gravatar_id":"","url":"https://api.github.com/users/revskill10","html_url":"https://github.com/revskill10","followers_url":"https://api.github.com/users/revskill10/followers","following_url":"https://api.github.com/users/revskill10/following{/other_user}","gists_url":"https://api.github.com/users/revskill10/gists{/gist_id}","starred_url":"https://api.github.com/users/revskill10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revskill10/subscriptions","organizations_url":"https://api.github.com/users/revskill10/orgs","repos_url":"https://api.github.com/users/revskill10/repos","events_url":"https://api.github.com/users/revskill10/events{/privacy}","received_events_url":"https://api.github.com/users/revskill10/received_events","type":"User","site_admin":false},"labels":[{"id":984757595,"node_id":"MDU6TGFiZWw5ODQ3NTc1OTU=","url":"https://api.github.com/repos/hasura/graphql-engine/labels/c/server","name":"c/server","color":"f2a4ea","default":false},{"id":1002119320,"node_id":"MDU6TGFiZWwxMDAyMTE5MzIw","url":"https://api.github.com/repos/hasura/graphql-engine/labels/k/ideas","name":"k/ideas","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-10-27T01:37:19Z","updated_at":"2018-11-02T05:34:44Z","closed_at":null,"author_association":"NONE","body":"In an application, one user often have multi roles at the same time, at a screen.\r\nLet's say, in a blog application, both editor and author could edit a post. So if a user is both an editor and an author, how to authenticate with hasura then ? \r\nIn this case, hasura should support multi-roles in headers: `x-hasura-roles` instead of `x-hasura-role`.\r\nElse how do you decide which role the user should use ? Because all roles are equal and valid.\r\n"},"comment":{"url":"https://api.github.com/repos/hasura/graphql-engine/issues/comments/435276147","html_url":"https://github.com/hasura/graphql-engine/issues/877#issuecomment-435276147","issue_url":"https://api.github.com/repos/hasura/graphql-engine/issues/877","id":435276147,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTI3NjE0Nw==","user":{"login":"go4cas","id":12674784,"node_id":"MDQ6VXNlcjEyNjc0Nzg0","avatar_url":"https://avatars1.githubusercontent.com/u/12674784?v=4","gravatar_id":"","url":"https://api.github.com/users/go4cas","html_url":"https://github.com/go4cas","followers_url":"https://api.github.com/users/go4cas/followers","following_url":"https://api.github.com/users/go4cas/following{/other_user}","gists_url":"https://api.github.com/users/go4cas/gists{/gist_id}","starred_url":"https://api.github.com/users/go4cas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go4cas/subscriptions","organizations_url":"https://api.github.com/users/go4cas/orgs","repos_url":"https://api.github.com/users/go4cas/repos","events_url":"https://api.github.com/users/go4cas/events{/privacy}","received_events_url":"https://api.github.com/users/go4cas/received_events","type":"User","site_admin":false},"created_at":"2018-11-02T05:34:44Z","updated_at":"2018-11-02T05:34:44Z","author_association":"NONE","body":"The way I think about it is that you have two sets of roles: the roles defined on the table, and the roles assign to the user. The check should be as simple as: \"do any of the roles defined on the table appear in the list of roles for the user? If so, grant permission. If not, 'permission denied!'\""}}
{"actor":{"display_login":"go4cas"}}