This repository has been archived by the owner on Jun 5, 2022. It is now read-only.
This release adds a few extra tools to make dealing with permissions easier.
globalStack
- This is aPermissionTreeStack
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.