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

[Backend] Create access decorators for all types of users #136

Open
amlannandy opened this issue Mar 2, 2021 · 0 comments · May be fixed by #137
Open

[Backend] Create access decorators for all types of users #136

amlannandy opened this issue Mar 2, 2021 · 0 comments · May be fixed by #137

Comments

@amlannandy
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, only some routes are being protected and can be used only by admins. The plan is to add such protection for all other user types.
For example -

  1. Only extractors should be able to access extraction routes
  2. Only management should be able to access case routes

Also currently, for all admin routes, we're manually checking in every single route, which creates a lot of repeated code, and it will also be a hassle to change it in the future.

Describe the solution you'd like

We can create decorator functions for each access level.
For example - I can create a decorator called 'extractor_only;
And if I just add that decorator to a route, then that route would be accessible to only extractors. I wouldn't have to manually write the logic in each route.

Describe alternatives you've considered
N/A

Additional context
I'll soon submit a PR for it.

@amlannandy amlannandy linked a pull request Mar 2, 2021 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant