Skip to content

Centralise user permissions #1256

@OliverDudgeon

Description

@OliverDudgeon

Currently when we need to check if a particular action is allowd by a given user based on a org, unit or project, the check is carried out in the component. It would be better to separate this business logic to a centralised location. I forsee this as a map that takes a "action" and maps it to the access rights required to do the action. For example the action modifyProjectEditors would require either PROJECT_EDITOR or PROJECT_ADMIN.

We can also provide react hooks to carry out these checks based on a passed org, unit or project.

Prehaps the source of the permissions object could be provided by an API so there is a single source of truth? @alanbchristie thought?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions