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

API: Update authority-checker.service.ts to allow checking for multiple authorities #196

Open
rajdip-b opened this issue Apr 30, 2024 · 0 comments
Labels
difficulty: 3 foss hack Clustering all the curated issues for Foss Hack 2024 help wanted Extra attention is needed priority: medium scope: api Everything related to the API type: enhancement New feature or request

Comments

@rajdip-b
Copy link
Member

rajdip-b commented Apr 30, 2024

Description

The authority check input in authority-checker.service.ts file currently takes the following interface as its input type:

AuthorityInput {
  userId: string
  entity: {
    id?: string
    name?: string
  }
  authority: Authority
  prisma: PrismaClient
}

The problem with this approach is, we are not able to check multiple authorities at once. Ideally, we would want authority to be renamed to ...authorities: Authority[]. This will allow us to pass multiple authorities so that we can check them at once.

Ideally, we would like the comparison in the functions to be set difference operations.

Solution

  • Refactor the authority field and all its occurrences
  • Then, pass the required authorities and collective authorities into this function to check for any overlap.
  • Add relevant tests for each of project, environment, workspace, secret, variable and approval in individual .e2e.spec.ts files in the modules
@rajdip-b rajdip-b added type: enhancement New feature or request help wanted Extra attention is needed scope: api Everything related to the API labels Apr 30, 2024
@rajdip-b rajdip-b changed the title API: Add set disjoint operation in authority-checker.service.ts API: Update authority-checker.service.ts to allow checking for multiple authorities Jun 12, 2024
@rajdip-b rajdip-b added foss hack Clustering all the curated issues for Foss Hack 2024 difficulty: 3 labels Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 3 foss hack Clustering all the curated issues for Foss Hack 2024 help wanted Extra attention is needed priority: medium scope: api Everything related to the API type: enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant