2023.41.0-RELEASE • Published 2 years ago

@hexworks/cobalt-authorization v2023.41.0-RELEASE

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Authorization Utility for Cobalt

This package provides a simple PBAC (Policy Based Access Control) utility for Cobalt.

Usage

Let's say that you have a function that you'd like to authorize:

First you should define your roles:

```ts
export const Role = {
    Anonymous: "Anonymous",
    User: "User",
    Administrator: "Administrator",
} as const;

export type Role = keyof typeof Role;

Then