@edular/permissions
v12.8.0
Published
![current npm version](https://img.shields.io/npm/v/@edular/permissions?label=%40edular%2Fpermissions)
Downloads
768
Readme
@edular/permissions
Shared constants and utils for permissions handling in Edular
project.
How to use the library
yarn add @edular/permissions
or
npm install --save @edular/permissions
Use it in the code:
import { Permissions } from '@edular/permissions'
// ...
const doesProfileHavePermissions = profilePermissions.includes(Permissions.Admissions.Students.View)
if (doesProfileHavePermissions){
// do something
}
Permissions
The repository contains the permissions.ts
file that exports Permissions
object — all available permissions.
The file is generated based on the permissions list from the main Edular database.
Scripts
build
— building the library artifacts (lib/
directory)build:clean
— clean the build directorylib/
generate-permissions
— generatepermissions.ts
with thePermissions
object exported
How to publish new version
- Start the edular-core and run
yarn generate-permissions
to generate newpermissions.ts
. - Commit the change and run
npm version major|minor|patch -m "bump %s"
to bump new version. - Publish to npm registry by running
yarn publish
. - Update the
version
inpackage.json
manually or usenpm
for that:
npm version <major|minor|patch>
Commit the changes and push them to the remote repository
Publish new version to npm registry
npm publish