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

User API Permissions: Restrict based on role #3096

Closed
ErisDS opened this issue Jun 25, 2014 · 0 comments · Fixed by #3395
Closed

User API Permissions: Restrict based on role #3096

ErisDS opened this issue Jun 25, 2014 · 0 comments · Fixed by #3395
Assignees
Labels
affects:api Affects the Ghost API

Comments

@ErisDS
Copy link
Member

ErisDS commented Jun 25, 2014

In #2264 the permissions for the user API were defined as:

JSON API Admin Editor Author NoAuth
users.browse y y y
users.read y y y y
users.edit y y y (user == self)
users.add y y

This is not quite correct, and should be:

JSON API Admin Editor Author NoAuth
users.browse y y y
users.read y y y y
users.edit y y (user == author) y (user == self)
users.add y y (user == author)

This is related to #3080 and #3083

@ErisDS ErisDS added this to the 0.5 Multi-user milestone Jun 25, 2014
@ErisDS ErisDS mentioned this issue Jul 1, 2014
26 tasks
@ErisDS ErisDS self-assigned this Jul 8, 2014
ErisDS added a commit to ErisDS/Ghost that referenced this issue Jul 17, 2014
refs TryGhost#3283, refs TryGhost#2739, refs TryGhost#3096

- Renames permissions which didn't follow bread
- Adds permissions for notifications, mail and tags

Still todo:

- wire up the new permissions where they are needed
- add permissions for roles
ErisDS added a commit to ErisDS/Ghost that referenced this issue Jul 28, 2014
refs TryGhost#3083, TryGhost#3096

In order to implement advanced permissions based on roles for specific
actions, we need to know
what role the current context user has and also what action we are
granting permissions for:
- Permissible gets passed the action type
- Effective permissions keeps the user role and eventually passes it to
  permissible
- Fixed spelling
- Still needs tests
ErisDS added a commit to ErisDS/Ghost that referenced this issue Jul 28, 2014
closes TryGhost#3096, closes TryGhost#3378, refs TryGhost#3100

- user.permissible updated to reflect proper permissions
- small amount of API refactoring to handle extra cases
- extensive integration testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:api Affects the Ghost API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant