Hi folks,

I recently published my first npm module.  It's a very short (~100 loc) 
library for gluing authorization rules into express middleware.

https://github.com/nomic/roz

I poked through the existing authorization modules, but didn't find quite 
want I wanted for my JSON api.  I explain my motivations and how to use it 
in the README.  I'm definitely curious if you have any feedback.  Here's a 
brief example of using the library:


var roz = require("roz")(),
    grant = roz.grant,
    where = roz.where;

var rozed = roz.wrap(app);   // wrap your express app

rozed.del( "/posts/:id",
           roz( grant( where ( isCreator, actor, "id" ))
                grant( where ( isAdmin, actor ))),
           ... );

function isAdmin(user, cb) { cb(null, user.admin === true) }
function isCreator(user, postId, cb) { ... }

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to