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

Releases: rpitv/glimpse-permissions

v0.1.3 - Add PermissionTools

19 May 23:55
Compare
Choose a tag to compare

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.

v0.1.2 - Update README.md

17 May 23:34
Compare
Choose a tag to compare

The repository had changes to its Github workflow. It's necessary to publish a new release to update the README with the new badges.

v0.1.1 - Remove Unnecessary files from Publish

17 May 22:28
Compare
Choose a tag to compare
  • Remove .eslintcache from published package

v0.1.0 - Initial Release

17 May 22:21
Compare
Choose a tag to compare

This is the initial release of this project.

Features

PermissionScope class

  • Target your permissions to specific subsections of applications/tools.
  • Scopes are formatted as tierOne:tierTwo:tierThree:...
  • Scopes support wildcards for tiers, however wildcards cannot be combined with other text.
    • e.g., sample:*:scope has a wildcard in tier two, but sample:*substring*:scope does not.

PermissionState enum

  • Permissions can have three states: ALLOW, DENY, or NONE to inherit.

Permission class

  • Permissions are essentially just a way to pair a PermissionScope to a PermissionState.

PermissionTree class

  • Group permissions together logically based off of user or group, for example.
  • Permissions have a specific order to how they are evaluated, and rules for how it is determined whether one permission has priority over another in the event of conflicts.

PermissionTreeStack class

  • Stack multiple PermissionTrees on top of each other.
  • Useful when dealing with multiple permission trees applied to one user.
    • e.g., user is in multiple groups, or user is "mimicking" another user/group to see what they see with their permissions.
  • PermissionTreeStacks return the first matching Permission's state, or NONE if no PermissionTrees match.
    • In other words, the priority rules used in PermissionTrees do not apply to PermissionTreeStacks.