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

acl-sequelize

v0.3.5

Published

Node Acl Sequelize Backend

Downloads

322

Readme

Node Acl Sequelize Backend

acl-sequelize

npm version Build Status codecov Known Vulnerabilities License

Sequelize is an SQL ORM that supports many sql servers (mysql, mariadb, sqlite, postgres and mssql) OptimalBits/node_acl.

Features & Documentation

For ACL general use please see OptimalBits/node_acl. For Sequelize general use please see Sequelize Docs.

Installation

Using npm:

npm install acl
npm install sequelize
npm install [DIALECT] #One of the supported Sequelize dialects
npm install acl-sequelize

Getting Started

    Acl       = require('acl');
    Sequelize = require('sequelize'),
    AclSeq    = require('acl-sequelize');
    db        = new Sequelize( 'DB', 'USER', 'PASSWORD'),    
    acl       = new Acl(new AclSeq(db, { prefix: 'acl_' }));

Extra Options

The second parameter sent to the backend constructor can have supports the following options -

prefix - prefix for table names in the database default ''

defaultSchema - Sequlize Schema settings for all buckets with no specific schema default schema has two columns key: Primary STRING, value: STRING

schema - Object with Sequlize Schema settings per bucket (meta|parents|permissions|resources|roles|users ) to override default schema

Creating tables manually

ACL-Sequelize will automatically register and sync needed schemes if for some reason you need to register your own tables and the schema override parameters are not good enough you can register the schemes yourself before instiating the backend. ACL-Sequelize will use the existing schema instead of adding a new one (Register schema should follow prefix+bucket_name convention and have key, value columns)

Testing

Test setup

The test database connection settings are in the test/runner.js. The current setting expect a local mysql server with passwordless root account and test database.

Running tests

npm test

Changelog

See changelog file

Security issues

This project participates in the Responsible Disclosure Policy program for the Node.js Security Ecosystem. see security.md for more info

Known Issues

  • default schema limit each column 255 chars, if you have a lot of resources / permissions / complex hierarchy, You'll probably need to set your own schema with higher limit.
  • node ACL has a race condition bug I would avoid setting multiple permissions until the issue is resolved
  • I haven't done any performance tweaks, this can probably be implemented in a much more efficient way using relational schema and JOINS, but I'm note sure node ACL API is flexible enough to make it beneficial

P.S Thanks for Robert Kaufmann III [email protected] who originally registered the npm module.