@sazze/acl

Access Control Library

Usage no npm install needed!

<script type="module">
  import sazzeAcl from 'https://cdn.skypack.dev/@sazze/acl';
</script>

README

ACL

Access Control Library

Usage

var acl = require('@sazze/acl')(config);

var levels = acl.LEVELS;

API

acl.is[LevelName](level: Integer): Boolean

Checks if the given level is >= the value corresponding to the LevelName

acl.eq[LevelName](level: Integer): Boolean

Checks if the given level is == the value corresponding to the LevelName

acl.isAtLeast(levelYouHave: Integer, levelYouWant: Integer): Boolean

Checks if the levelYouHave >= the levelYouWant it to be

acl.getAvailableLevels(levelYouHave: Integer): Array

Returns and array of all levels this user has access to