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

Permissions and Models.User.permissable #3378

Closed
jaswilli opened this issue Jul 23, 2014 · 1 comment
Closed

Permissions and Models.User.permissable #3378

jaswilli opened this issue Jul 23, 2014 · 1 comment
Assignees
Labels
bug [triage] something behaving unexpectedly

Comments

@jaswilli
Copy link
Contributor

There's a hook in the permissions system where a model class can have a permissable method which allows it to make a decision on pending operations against it:
https://github.com/TryGhost/Ghost/blob/master/core/server/permissions/index.js#L123

The User model does this:
https://github.com/TryGhost/Ghost/blob/master/core/server/models/user.js#L446

Which needs to be rethought before MU ships as it opens up a potential privilege escalation issue (e.g., a user can change his or her role).

@ErisDS ErisDS added this to the 0.5 Multi-user milestone Jul 24, 2014
@ErisDS
Copy link
Member

ErisDS commented Jul 24, 2014

I'm working on the issue #3096, which means that this code in User.permissable:

https://github.com/TryGhost/Ghost/blob/master/core/server/models/user.js#L446

Which is intended to allow the owner of an object to perform any operation, will only be executed for authors performing an edit action. Which should significantly reduce the problem.

The code which manages editing a user handles the role relation separately: https://github.com/TryGhost/Ghost/blob/master/core/server/models/user.js#L301

And it does need an additional canThis check on assigning roles.

I'll take this on because it overlaps neatly with what I'm working on right now.

@ErisDS ErisDS self-assigned this Jul 24, 2014
@ErisDS ErisDS closed this as completed in 987e927 Jul 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

2 participants