feature: multiple directive
Eomm opened this issue · comments
Manuel Spigolon commented
It would be great to support multiple directives:
@hasRole
@hasPermission
Example:
type Article {
id: ID!
title: String!
content: String! @hasPermission(resources: ["subscribed"])
}
type Query {
listArticles: [Article]!
}
type Mutation {
publishArticle(articleId: ID!): Article! @hasRole(role: "editor")
unpublishArticle(articleId: ID!):Boolean @hasPermission(resources: ["publish","delete"])
}
Doing so, it should be open to integrating external Identity Management such as:
- keycloak
- Auth0 Authorization extension
- any Identity Manager that implements the User -> Role -> Permission paradigm
Jonny Green commented
Great idea! I think it's currently possible to do this in the meantime by registering the plugin twice?
Either way, I think this would be great feature to explicitly support, would you be interested in submitting a PR for this?
Manuel Spigolon commented
Yes @jonnydgreen, I'm working on it
Could you assign me this issue?
I wonder if it's currently possible to do this in the meantime by registering the plugin twice?
I will try it and add tests&docs if it works
Jonny Green commented
Awesome, thanks and thanks!