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

Fetch minimal set of fields when doing only permissions checks #42

Open
petli opened this issue Jul 11, 2014 · 0 comments
Open

Fetch minimal set of fields when doing only permissions checks #42

petli opened this issue Jul 11, 2014 · 0 comments

Comments

@petli
Copy link
Member

petli commented Jul 11, 2014

Most of the Media operations on works in modules/core/lib/work.js need to get the work to check permissions, and possibly also Work.media to be able to manipulate the list. The relevant calls to db.Work.findByIdAsync should add the parameter to select the minimal set of fields to avoid dragging in annotations etc.

Better list the permission fields as a constant, refering to it later, to make it easy to add as we extend the permission system.

Current list of affected functions are:

  • getWorkMedia
  • createWorkMedia
  • removeMediaFromWork
  • unlinkAllMedia
  • addMediaToWork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant