mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
zerver/lib/users.py has a function named access_user_by_id, which is used in /users views to fetch a user by it's id. Along with fetching the user this function also does important validations regarding checking of required permissions for fetching the target user. In an attempt to solve the above problem this commit introduces following changes: 1. Make all the parameters except user_profile, target_user_id to be keyword only. 2. Use for_admin parameter instead of read_only. 3. Adds a documentary note to the function describing the reason for changes along with recommended way to call this function in future. 4. Changes in views and tests to call this function in this changed format. Changes were tested using ./tools/test-backend. Fixes #17111.
21 KiB
21 KiB