Skip to content

Instantly share code, notes, and snippets.

@iskenxan
Created May 17, 2021 02:22
Show Gist options
  • Save iskenxan/f9cd7a52c984c3ca75cab43f86fd4131 to your computer and use it in GitHub Desktop.
Save iskenxan/f9cd7a52c984c3ca75cab43f86fd4131 to your computer and use it in GitHub Desktop.
export const ROLES = {
viewer: "VIEWER",
editor: "EDITOR",
owner: "OWNER"
};
export const SCOPES = {
canCreate: "can-create",
canEdit: "can-edit",
canDelete: "can-delete",
canView: "can-view"
};
export const PERMISSIONS = {
[ROLES.viewer]: [SCOPES.canView],
[ROLES.editor]: [SCOPES.canView, SCOPES.canEdit],
[ROLES.owner]: [
SCOPES.canView,
SCOPES.canEdit,
SCOPES.canCreate,
SCOPES.canDelete
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment