Skip to content

Implement basic backend endpoint permissions #163

Open
@dct0

Description

@dct0

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions