-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add user groups to api #192
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
Conversation
- adds helper function for filtering - checks preference manager for "filter_zones_by_group" setting. If not present, defaults to True
- this is the case where no fsps are available from the central server (local setup)
- adds helper function for filtering - checks preference manager for "filter_zones_by_group" setting. If not present, defaults to True
- this is the case where no fsps are available from the central server (local setup)
- as opposed to fetching each preference separately, with one request per preference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks correct but I ran into a fatal error that causes the application to stop:
This happens because the fsp is not defined for some favorites:
I'm guessing that this happens because I have favorites to folders outside of my groups.
Also, is there are any reason that the filtering must be server-side? What if we returned the groups as part of the user's profile (/api/fileglancer/profile
) which is always requested? Then the filtering could be done quickly on the client side whenever the preference is changed, without additional requests.
@krokicki I was just starting to think I should do the filtering client-side, motivated by the fact that the request to /file-share-paths is getting cached by the browser and I'm having a hard time forcing it to ignore the cache when the filtering preference changes. |
- also delete unneeded should_show_fsp function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! I made a commit to tweak the wording a bit.
Clickup ids: 86aagg1rp and 86aafecg5
This PR is dependent on PR #31 in fileglancer-central.
This PR adds the user groups membership to the data returned by the /profile endpoint, and adds a "isFilteredByGroups" preference that defaults to True. In the client, the Zones are filtered by group membership when this preference is true. The user can toggle the preference on the Preferences page. There is a note at the bottom of the Zone browser indicating whether this preference is on or off with a link to the Preferences page for the user to modify the preference, if desired.
@krokicki