Giter Site home page Giter Site logo

node_acl's People

Contributors

0xashish avatar akashdeepsinghal avatar alonl avatar atinux avatar c0d3x42 avatar caasjj avatar danielrohers avatar devinea avatar diversario avatar fyockm avatar gabeisman avatar gkampitakis avatar inolasco avatar jac1013 avatar jonmassot avatar jurko-gospodnetic avatar koresar avatar lancers avatar leodutra avatar listepo avatar manast avatar mertcetin avatar mgcrea avatar nemtsov avatar paulhill avatar santhisenan avatar stevenblack avatar toni-lahnalampi avatar tthew avatar yonjah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node_acl's Issues

Annoying duplicates error

I get this: insert into "acl_permissions" ("key", "value") values ($1, $2) - duplicate key value violates unique constraint "acl_permissions_pkey" when I try to create (using acl.allow) two identical roles, but with different names, and different permissions BUT the same resources. How do I even deal with this? ๐Ÿ˜•

Support for the Wildcards in Resource names if it is a url for express

Problem Statement

Hello, i am using this package and so far its going great, but a small thing is annoying me which is if i am using express url's as resource names in the acl allow rules then the wild cards are not supported e.g.

/api/users/login (resource 1)
/api/users/signup (resource 2)
/api/users/lremove (resource 3)

e.g. in config they would be written as

{
    "roles": [ "User" ],
    "allows": [
      { "resources": "/api/users/login", "permissions": [ "post", "put", "get", "delete" ] },
      { "resources": "/api/users/signup", "permissions": [ "post", "put", "get", "delete" ] },
      { "resources": "/api/users/remove", "permissions": [ "post", "put", "get", "delete" ] }
    ]
  }

Problem Solution Expected

now to allow these to user we have to define these separately instead of this i am expecting some thing like following in the config

{
    "roles": [ "User" ],
    "allows": [
      { "resources": "/api/users/*", "permissions": [ "post", "put", "get", "delete" ] }
    ]
  }

Bluebird Dependency

Bluebird folks are pushing people to move to Promises.
Any plan for this replacement? Or is the project dormant?
I'm a PM so please don't ask me for a PR :)
Thanks.

Missing index on `key` property on Mongodb

I created an issue to the original repository just in case someone has the same issue. What was noticed is that the library creates an index

collection.createIndex({ _bucketname: 1, key: 1 }, (err) => {
and then in the case of the useSingle=false we are not using this index as we are querying with just the key meaning we are not using the index resulting to slow queries. Maybe the index could respect the useSingle flag and create the correct index.

var updateParams = this.useSingle ? { _bucketname: bucket, key: key } : { key: key };

Sorry to open a new issue

I don't know how to find/contact you, but could you publish it to npm as well? the recent fix? I'm using it and I need the latest one XD Thanks

Bluebird to Native Promise?

Any chance you will be removing Bluebird?
Bluebird is a dead project since node supports Promises natively.

Get resources and permissions grouped by role

I have gone through the packages and I couldn't find any appropriate method for listing roles, resources and their permissions on it.

/**
  whatResources(role, function(err, {resourceName: [permissions]})

  Returns what resources a given role or roles have permissions over.

  whatResources(role, permissions, function(err, resources) )

  Returns what resources a role has the given permissions over, even I pass roles as an array.

  @param {String|Array} Roles
  @param {String|Array} Permissions
  @param {Function} Callback called wish the result.
*/

It return data like below,

{
  resource: [permissions]
}

But it doesn't return what role has what permissions.
I want something like below,

[{
  role: 'super-admin',
  resourcePermissions: [
    {
      resource: 'orders',
      permissions: ['get', 'put']
    },
    {
     resource: 'payments',
     permissions: ['get', 'delete']
  ]
},
....
]

How can I import in Typescript ES6?

import * as ACL from 'acl2';

pic1

npm install acl2 has successfully finished but I can't import the module.
Every examples in repository are written in ES5 grammar. How can I use it in TypeScript ES6?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.