Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

v0.1.3 - Add PermissionTools

Latest
Compare
Choose a tag to compare
@robere2 robere2 released this 19 May 23:55
· 1 commit to dev since this release

This release adds a few extra tools to make dealing with permissions easier.

  • globalStack - This is a PermissionTreeStack which is global throughout the running process. This makes accessing it from anywhere easier, and allows for easier interaction between libraries.
  • formatScope() - Format a scope string with variables.
    • In many cases this could be replaced with template literals, however this method allows for more strict formatting and simplified re-use of variables.
  • assertPermission() - Assert that the global permission tree stack evaluates a given permission scope to ALLOW. If not, then an error is thrown, which can be handled upstream.
  • AccessDeniedError - Extension of Error which takes in a scope instead of a message.