-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add /api/admin authorization #10
base: master
Are you sure you want to change the base?
Conversation
The dito way is something like this:
|
There is some documentation about this in the comments of
|
You can also check against multiple roles by providing an array: |
authorize can be set on a per controller and per action level |
Okay, so this entails adding a |
# Conflicts: # src/server/controllers/api/admin/dummies.js
I added user roles to this PR here: b03ebdb |
I guess a next step would be to allow editing / creating users when you have the |
I noticed that the
/api/admin/dummies
endpoints were not protected with the same authentication as the admin panel.Perhaps there is a better way to do this, but adding
authorize = ctx => ctx.isAuthenticated()
to the /api/admin/dummies controller does the trick.