trailsjs / sails-permissions

Comprehensive user permissions and entitlements system for sails.js and Waterline. Supports user authentication with passport.js, role-based permissioning, object ownership, and row-level security.
MIT License
418 stars 113 forks source link

sails-permissions standalone #162

Open fenos opened 9 years ago

fenos commented 9 years ago

Hi, this package seem brilliant, I have a project with sails which has a custom authentication, would be possible to use sails-permissions without depending on sails-auth? It would be amazing

spacesuitdiver commented 9 years ago

I was reading through much of the code and it seems very feasible that this project could work without sails-auth as long as you have some policies which mimic the sails-auth policies, you'd need something to add req.user for instance. It's a shame really that it wasn't decoupled to begin with but I have a fork I'm working on to see how far I can get.

spacesuitdiver commented 9 years ago

I have it working but I got to a point that the only things left my code is using from the module are services, and a few bits of code in the hook to spin up default data and inject ownership attributes into the models. I wish I could have figured out how to keep the policies intact but for some reason it didn't recognize them unless I pulled them out of the module.

This was a good exercise but honestly you might just be better off taking what you need out of this module.