dotperms 0.1.0

A simple library for LuckPerms-like authorization using permission nodes.
Documentation
  • Coverage
  • 100%
    16 out of 16 items documented1 out of 14 items with examples
  • Size
  • Source code size: 24.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.78 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nm17

dotperms

An opinionated, but simple library for LuckPerms-like authorization using permission nodes.

Rules of the algorithm.

  • This function MUST NOT return a [Result]. All of it's behaviour in response to invalid permissions nodes MUST be deny-first. Any invalid permissions MUST be ignored and any invalid requirements MUST be impossible to satisfy.
  • Any given permission MUST allow any other requirements under the same jurisdiction.
  • Any given permission with any amount of context should only allow requirements with the same context values.
  • The "" permission node MUST NOT allow ANY requirements. This is a conscious choice by the developer of the library in order to prevent an accidentally placed empty string into the permissions of a user, which will result in him getting access to everything in a given system.
  • The "*" permission part MUST allow all requirements below itself, BUT the rules of context apply.
  • The "" or "*" permission parts and anything that follows it MUST be cut off.
  • Any permission part that contains "", but is not exactly "" MUST be considered empty.

From the LuckPerms Github Wiki:

A permission is just a string, and is separated into parts using periods. For example, “minecraft.command.ban” is the permission for the /ban command. Obviously we don’t want all users to have access to this, so we only give it to users we trust.

The string that represents a certain permission is also sometimes called a “permission node” or just “node” for short.

Context in the most basic sense simply means the circumstances where something will apply.

A single "context" consists of a key and a value, and are represented in the form key=value.