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 all roles #27

Merged
merged 2 commits into from
Dec 12, 2018
Merged

Fetch all roles #27

merged 2 commits into from
Dec 12, 2018

Conversation

mcbouslog
Copy link
Contributor

  • fetch all roles
  • filter for owner/collab
  • if owner/collab then allow explorer view

@mcbouslog mcbouslog merged commit 9605cb4 into master Dec 12, 2018
@mcbouslog mcbouslog deleted the fetch-all-roles branch December 12, 2018 23:27
@camallen
Copy link

@mcbouslog - a bit late to the party on this but if you are authenticated as a user, you can filter role lookups for the logged in user instead of requesting all of them and then filtering them out and checking if they are for that user. It should be quicker to fetch the requesting user roles only (if you are logged in).

Pass in the user_id you want to filter for (it can actually take a list of user ids, '1,2,3'), docs are https://panoptes.docs.apiary.io/#reference/projectrole/projectrole-collection/list-all-projectroles
relevant code https://github.com/zooniverse/Panoptes/blob/2b1e23182adb5e9b19994d4c24d020cdc6121fb2/app/controllers/concerns/roles_controller.rb#L52

Ideally we would allow you to specify which roles you want to filter for API side as well instead of filtering client side...zooniverse/panoptes#1575

@mcbouslog
Copy link
Contributor Author

Thanks! I'll refactor accordingly.

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 this pull request may close these issues.

2 participants