franciscogouveia / hapi-rbac

RBAC (Rule Based Access Control) for hapijs
ISC License
105 stars 20 forks source link

[feature request]possibility of retrieving rbac rules via promise #12

Closed gitawego closed 8 years ago

gitawego commented 8 years ago

firstly, thanks for your great plugin, it's the most flexible authorization plugin for hapijs. but I'd like to be able to store the rbac setting in database and retrieve them via a promise, so admin can dynamically change the rules without restarting the server. I think the simple way is to detect if request.route.settings.plugins.rbac a function, if yes, execute it and get a promise.

thanks in advance

franciscogouveia commented 8 years ago

I agree that this feature would be great and I like your suggestion of accepting a function on the rbac configuration. I would use a normal callback function instead of a promise though.

I will look into it.

franciscogouveia commented 8 years ago

@gitawego Can you please check if it covers your case?

gitawego commented 8 years ago

yes, it seems promising, I'm gonna test tonight. thanks a lot :)

franciscogouveia commented 8 years ago

You are welcome :) I will close the issue