Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move per-route RBAC to OpenAPI via extensions #249

Open
Southclaws opened this issue Oct 19, 2024 · 0 comments
Open

Move per-route RBAC to OpenAPI via extensions #249

Southclaws opened this issue Oct 19, 2024 · 0 comments

Comments

@Southclaws
Copy link
Owner

as mentioned in #248 we can generate additional per-route middleware for each operation. Currently, RBAC is implemented by generating this huge interface from which the implementation maps operations to either a permission, a rather obscure "this route is permissioned but it's implemented elsewhere due to ownership rules etc" and "no permission required".

This can be better expressed in OpenAPI:

/threads:
  post:
    x-storyden-rbac:
      permission: CREATE_THREAD
  patch:
    x-storyden-rbac:
      permission: CUSTOM (?) # 

It could also make sense to include the permissions even of operations that aren't explicitly checked at the middleware layer but are checked later based on data queried (such as ownership)

/threads:
  patch:
    x-storyden-rbac:
      permission: UPDATE_THREAD
      checked_internally: true # skips checking at middleware, assumes it will be checked at service layer
@Southclaws Southclaws moved this to Backlog in Storyden Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant