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

ClientApplication endpoint ignores :projectId as SuperAdmin #2717

Closed
rahul1 opened this issue Aug 24, 2023 · 0 comments · Fixed by #2722
Closed

ClientApplication endpoint ignores :projectId as SuperAdmin #2717

rahul1 opened this issue Aug 24, 2023 · 0 comments · Fixed by #2722
Assignees
Labels
auth Authentication and authorization features and fixes bug Something isn't working

Comments

@rahul1
Copy link
Member

rahul1 commented Aug 24, 2023

The endpoint /admin/projects/:projectId/client currently ignores the :projectId param. This prevents users from inviting

We should replicate the functionality In the /invite endpoint:

  • Most of the time, we read the project id from res.locals
  • But if the user is Superadmin, wer read the project id from the URL params

const inviteRequest = { ...req.body } as ServerInviteRequest;
const { projectId } = req.params;
if (res.locals.project.superAdmin) {
inviteRequest.project = await systemRepo.readResource('Project', projectId as string);
} else {
inviteRequest.project = res.locals.project;
}

@rahul1 rahul1 added bug Something isn't working auth Authentication and authorization features and fixes labels Aug 24, 2023
@rahul1 rahul1 self-assigned this Aug 24, 2023
@ThatOneBro ThatOneBro self-assigned this Aug 25, 2023
@ThatOneBro ThatOneBro added this to the August 31, 2023 milestone Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Authentication and authorization features and fixes bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants