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

[Backend] Modify Project Access Endpoint #270

Open
FelipePSoares opened this issue Nov 25, 2024 · 0 comments
Open

[Backend] Modify Project Access Endpoint #270

FelipePSoares opened this issue Nov 25, 2024 · 0 comments

Comments

@FelipePSoares
Copy link
Owner

FelipePSoares commented Nov 25, 2024

Create an endpoint in the ProjectsController to manage project access permissions. This will allow admins to update the list of users and their permissions for a specific project.

  1. Endpoint:

    • Add a PATCH endpoint to the ProjectsController.
    • URL: /api/projects/{projectId}/access
    • HTTP Method: PATCH
  2. Request:

    • Accept a payload containing a list of users and their corresponding permissions.
    • Example structure (the structure will be a little bit different because is a JsonPatchDocument):
[
  {
    "userId": "string",
    "userEmail": "string",
    "permission": "enum (e.g., Admin, Manager, Viewer)"
  }
]
  1. Logic:

    • for each add user:
      • validate if a user with this email exist:
        • If exists get id and create invite sending email with token in the URL to accept invite.
        • If not exists, send email with invite to create account with invite token in the URL to create account.
  2. Validation:

    • Ensure that the user that is trying to edit the access is the admin of the project.
      • You can use the AccessControlService for that.
    • Need to exist at least one admin in the project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

1 participant