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

feat(server): Add publicUsers toggle for user search #14330

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

samholton
Copy link
Contributor

By default, when a user adds an immich user to a shared library, the user-selection-modal shows a list of all users (email and name) on the server. This can be problematic on a more public server used by multiple groups that you don't want to leak names and emails. The long term fix is the proper groups/organizations structure.

This is a short term fix that adds a publicUsers server setting. By default, this will be true to maintain existing functionality. But if this setting is disabled, regular users will not see any users in the user-selection-modal. Admin users will still see all of the users and be able to add users to shared albums.

New Setting
image

What non-admin users will see on user-selection-modal

image

@github-actions github-actions bot added 🖥️web 🗄️server documentation Improvements or additions to documentation labels Nov 25, 2024
@alextran1502
Copy link
Contributor

Can you help test if the mobile app will need to patch this property in mobile\lib\utils\openapi_patching.dart by using the current release version of the app and login to the server in this PR?

@samholton
Copy link
Contributor Author

Can you help test if the mobile app will need to patch this property in mobile\lib\utils\openapi_patching.dart by using the current release version of the app and login to the server in this PR?

Sure. Is there a preview sever for this? I haven't done anything with mobile before. Or just use the Android app to login to my local server and test?

@samholton
Copy link
Contributor Author

I was able to login to my local server on an old Android device but seeing some issues. Going to test a bit more to see if its my device or this change

@samholton
Copy link
Contributor Author

samholton commented Nov 25, 2024

I am able to reproduce the issue on a second Android device. When the publicUsers is set to false and I create a new album, the add users to album displays no users to add (as expected). However, after the initial view of the album, it seems the app thinks I am no longer the owner. The add users, share, etc. options no longer show - just leave album.

Even if I set publicUsers back to true and close the app and clear the cache, it still doesn't see me as the owner. Clearing all app data and logging back into the app resolves the issue (with publicUsers set to true)

With publicUsers set to true, I can close the app and go back to the shared album and add users.

Maybe I should return a list of just the current user rather than []?

let users: UserEntity[] = [];

@samholton
Copy link
Contributor Author

Maybe I should return a list of just the current user rather than []?

let users: UserEntity[] = [];

This does seem to resolve the issue

let users: UserEntity[] = [auth.user];

@samholton samholton force-pushed the feature/add-public-users-toggle-for-user-search branch from 55edcc2 to 9977ae0 Compare November 25, 2024 05:08
@samholton
Copy link
Contributor Author

Can you help test if the mobile app will need to patch this property in mobile\lib\utils\openapi_patching.dart by using the current release version of the app and login to the server in this PR?

@alextran1502 does not appear to need any patching. I was able to use the current mobile app with the new setting both enabled and disabled. I did need to return a list with the current user rather than empty list (PR updated)

@samholton samholton force-pushed the feature/add-public-users-toggle-for-user-search branch from 9977ae0 to 2ccac65 Compare November 26, 2024 02:23
@alextran1502 alextran1502 enabled auto-merge (squash) November 26, 2024 15:47
@alextran1502 alextran1502 merged commit 5417e34 into main Nov 26, 2024
36 checks passed
@alextran1502 alextran1502 deleted the feature/add-public-users-toggle-for-user-search branch November 26, 2024 15:51
yosit pushed a commit to yosit/immich that referenced this pull request Dec 20, 2024
* feat(server): Add publicUsers toggle for user search

* tests

* docs: add check:typescript for web PR checklist

* return auth.user when publicUsers is false - app testing

---------

Co-authored-by: Alex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants