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

Implement basic backend endpoint permissions #163

Open
dct0 opened this issue Jan 6, 2024 · 2 comments · May be fixed by #221
Open

Implement basic backend endpoint permissions #163

dct0 opened this issue Jan 6, 2024 · 2 comments · May be fixed by #221
Assignees
Labels
backend Task must have a back end issue difficulty:hard

Comments

@dct0
Copy link
Contributor

dct0 commented Jan 6, 2024

Basic Information

Implement basic "yes" or "no" permissions to all our backend endpoint. See the blurb at the top of the spreadsheet for how this can be implemented. Ignore all references to organisations

Modify the API handler to also include permissions. Currently we have:

export default apiHandler({
  get: getItemTypes
});

Our proposed implemention will change it to something like:

ts
export default apiHandler({
  get: {
    controller: getItemTypes,
    permissions: permissionsMatrix.getItemTypes
  }
});

Then in a separate file, we have the giant permissions matrix, which will look like the spreadsheet.

const permissionsMatrix = {
  getItemTypes: { client: true, repairer: true, ... }
}

Other Information

Permissions spreadsheet (WIP)
https://docs.google.com/spreadsheets/d/18AxrBPgUUgtK0lcNLxSUmxFfxQERglB_L3c7OL6s9DE/edit?usp=sharing
Ignore all references to organisations

@dct0 dct0 added backend Task must have a back end issue difficulty:hard labels Jan 6, 2024
@dct0 dct0 changed the title [DRAFT] Implement basic backend endpoint permissions Implement basic backend endpoint permissions Jan 10, 2024
Copy link

@dct0 dct0 assigned justinliangg and unassigned justinliangg Jan 10, 2024
Copy link

@tommyjqliu tommyjqliu self-assigned this Feb 6, 2024
@tommyjqliu tommyjqliu linked a pull request Feb 15, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Task must have a back end issue difficulty:hard
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants