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

REST API to fetch project users #1843

Merged
merged 9 commits into from Aug 25, 2022

Conversation

vboctor
Copy link
Member

@vboctor vboctor commented Aug 21, 2022

  • /api/rest/projects/:id/users to get all users or all users with a specified access level or above. This functionality is available in SOAP API.
  • /api/rest/projects/:id/handlers to get all users that can be assigned issues in the project.

The user calling the API must have viewer access to the project. This was not enforced in SOAP API, but now it is.

Will submit a separate PR for Postman collection update, since there is a bunch of unrelated changes that accumulated over time.

Fixes #22791, #30907

If no access level specified, get all users that can access the project.

Fixes #22791
1. Query params should be modeled as query not option.
2. Remove pagination for SOAP API.
3. Use id instead of project_id for project_id.
4. Fix SOAP to return array of users.

Fixes #22791
A user that doesn't have VIEWER access to a project, shouldn't be able to query its users.

Fixes #22791
Fixes #22791
@vboctor vboctor self-assigned this Aug 21, 2022
Copy link
Member

@dregad dregad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of duplicated code between rest_project_users() and rest_project_handlers() - maybe this can be avoided using a helper function ?

@vboctor
Copy link
Member Author

vboctor commented Aug 24, 2022

@dregad I added the helper method.
@atrol removed the redundant check.

This should address all your comments.

@vboctor vboctor force-pushed the issue22791_rest_api_project_handlers branch 2 times, most recently from 15647bc to f3f6aac Compare August 24, 2022 01:21
api/soap/mc_project_api.php Outdated Show resolved Hide resolved
1. Remove redundant check.
2. Refactor functions that get project users to use helper function.
3. Fix warnings when user preference for language is set to auto.

ixes #22791
@vboctor vboctor force-pushed the issue22791_rest_api_project_handlers branch from f3f6aac to 9a42597 Compare August 25, 2022 03:30
@vboctor vboctor merged commit 1cff7d8 into mantisbt:master Aug 25, 2022
@vboctor vboctor added the api Pull requests that are related to APIs label Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Pull requests that are related to APIs
Projects
None yet
3 participants