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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@saltcorn/acl-rules

v0.0.1

Published

Access control plugin based on (Subject, Object, Verb) rules

Readme

acl-rules

A fine-grained access control plugin for Saltcorn, based on (Subject, Object, Verb) tuples:

  • Subject - a user, a role, or a formula over user
  • Object - a view, page, trigger, api route, or embedded view/page
  • Verb - get or post

The highest-priority matching rule decides the outcome (ties keep the earliest-listed rule; default priority for everyone is "first match wins"). A match always overrides Saltcorn's normal role check, in either direction. No match leaves the role check in charge.

Builds on the authorize_view/authorize_page/authorize_trigger/ authorize_api plugin hooks added to Saltcorn core in 1.7.

Status

Rules live as JSON in this plugin's own configuration.rules. lib/rules.js re-checks the current config on every hook call, caching the parsed result so an unchanged config isn't re-parsed. Editing goes through the plugin's own configuration_workflow (/plugins/configure/acl-rules) via one Form field, rendered by the AclRulesEditor fieldview (lib/fieldview.js server side, public/acl-rules-editor.js client side - a list + modal editor over a hidden JSON textarea).

Object name and Subject value offer real names (views/pages/triggers, role names/user emails) as datalist suggestions but stay free text, since a rule can target something not created yet.

Not yet done: manual rule reordering, and a condition formula ("Adjectives") to narrow a rule beyond subject/object/verb.

Rule fields

| Field | Meaning | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | object_kind | view | page | trigger | api | | object_name | Entity name, or * for any. For api, the route id (e.g. scapi/sc_tables). Secures the whole object, including its viewtemplate custom routes - no sub-route granularity. | | verb | get | post | any | | subject_type | public | role | user | formula | | subject_value | Comma-separated role names/emails for role/user, or a formula over user for formula. Ignored for public. | | effect | allow | deny | | priority | Number, default 0. Breaks ties among acl-rules' own matching rules, and against another plugin's authorize_* hook, higher wins. Editor shows Low/Normal/High (-10/0/10) with a switch to a raw number. | | enabled | Toggle without deleting. |

A request with no matching enabled rule falls through to Saltcorn's normal min_role check.

Tests

tests/rules.test.js covers evaluateRules() directly (object/verb/subject matching, wildcards, allow/deny/abstain), registering the plugin with an in-memory rules config rather than going through the save form. Run with:

saltcorn dev:plugin-test -d /path/to/acl-rules