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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gennode_acm

v1.0.2

Published

On new object creation, registers assigns data ownership for read,update and delete operations

Readme

GenNode ACM

Author

Nathan Mersha

Installation

GennodeACM library is available on npm, type:

$ npm i gennode_acm

Description

This module is a library to be plugged in your server. This library is one part of a cluster modules as defined in gennode_authorization The module is used to set access control model data on an object preferable on a post save hook as illustrated in the example below.

How to use it

1. Initialize the library with a constructor
let gennodeACM = require('gennode_acm');
let gennodeACMInstance = new gennodeACM({
    host        : "localhost",
    port        : 3400,
    endpoint    : "/auth/token/validate",
    connection  : "http"
});

| Configuration | Description | Default | |:------------:|:-----------:|:-----------:| |host |Gennode Authorization service host | localhost | |port |Gennode Authorization port | 3400 | |endpoint |Token validator endpoint | /auth/token/validate | |connection |Communication type (Current support : http) for future seneca support | http |

2. Define your schema
let schema = new Schema(
    // todo : Your Schema goes here
);
3. On a post save hook set your acm with default allowed accesses as illustrated below.
schema.post('save', function(doc) {
    let objectACM = {
        schemaName : "schemaName", // Defines the schema/model name
        serviceName : "serviceName", // Defines the service name where the schema is located
        object : doc._id, // Defines the object id ( or anything you consider unique )
        accessControl : { // Defines the default access roles on your data
            read : ["any"],
            update : ["Admin 1", "Admin 2", "Admin 3"],
            delete : ["Admin 2"],
        }
    };

    // Set acm here.
    gennodeACMInstance.setACM(objectACM, function (error, response, body) {
        console.log(response);
    });
});
Response
{
    "acmSubjects": [
        {
            "accessControl": {
                "read": [],
                "update": [
                    "5cee730bb2820d47582e9abd"
                ],
                "delete": []
            },
            "_id": "5d5a958cd9d8663585e8f342",
            "subject": "Admin 3",
            "firstModified": "2019-08-19T12:26:52.223Z",
            "lastModified": "2019-08-19T12:26:52.223Z",
            "__v": 0
        },
        {
            "accessControl": {
                "read": [],
                "update": [
                    "5cee730bb2820d47582e9abd"
                ],
                "delete": [
                    "5cee730bb2820d47582e9abd"
                ]
            },
            "_id": "5d5a958cd9d8663585e8f346",
            "subject": "Admin 2",
            "firstModified": "2019-08-19T12:26:52.232Z",
            "lastModified": "2019-08-19T12:26:52.232Z",
            "__v": 0
        },
        {
            "accessControl": {
                "read": [],
                "update": [
                    "5cee730bb2820d47582e9abd"
                ],
                "delete": []
            },
            "_id": "5d5a958cd9d8663585e8f345",
            "subject": "Admin 1",
            "firstModified": "2019-08-19T12:26:52.232Z",
            "lastModified": "2019-08-19T12:26:52.232Z",
            "__v": 0
        },
        {
            "accessControl": {
                "read": [
                    "5cee730bb2820d47582e9abd"
                ],
                "update": [],
                "delete": []
            },
            "_id": "5d5a958cd9d8663585e8f343",
            "subject": "any",
            "firstModified": "2019-08-19T12:26:52.224Z",
            "lastModified": "2019-08-19T12:26:52.224Z",
            "__v": 0
        }
    ]
}

Contributing

If you have anything in mind, feel free to create an issue here, or fork the project.