npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@infinitybots/kittycat

v1.2.0

Published

Kittycat permission system

Downloads

6

Readme

Kittycat TS

Typescript library for the kittycat permission system

Supported Operations

  • hasPerm
  • StaffPermissions#resolve
  • checkPatchChanges

Structure

A permission is defined as the following structure

namespace.permission

If a user has the * permission, they will have all permissions in that namespace If namespace is global then only the permission is checked. E.g. global.view allows using the view permission in all namespaces

If a permission has no namespace, it will be assumed to be global

If a permission has ~ in the beginning of its namespace, it is a negator permission that removes that specific permission from the user

Negators work to negate a specific permission excluding the global. permission* (for now, until this gets a bit more refined to not need a global.* special case)

Anything past the . may be ignored or indexed at the discretion of the implementation and is undefined behaviour

Permission Overrides

Permission overrides are a special case of permissions that are used to override permissions for a specific user. They use the same structure and follow the same rules as a normal permission, but are stored separately from the normal permissions.

Special Cases

  • Special case: If a * element exists for a smaller index, then the negator must be ignored. E.g. manager has ~rpc.PremiumAdd but head_manager has no such negator

Clearing Permissions

In some cases, it may desired to start from a fresh slate of permissions. To do this, add a '@clear' permission to the namespace. All permissions after this on that namespace will be cleared

TODO: Use enums for storing permissions instead of strings by serializing and deserializing them to strings when needed

Permission Management

A permission can be added/managed by a user to a position if the following applies:

  • The user must have the permission themselves. If the permission is a negator, then the user must have the 'base' permission (permission without the negator operator)
  • If the permission is *, then the user has no negators in that namespace that the target perm set would not also have

Note on point 2: this means that if a user is trying to add/remove rpc.* but also has ~rpc.test, then they cannot add rpc.* unless the target user also has ~rpc.test