문제

I'm trying to use declarative authorization to make dynamic authorization so I'm storing the roles and permissions in the database.

The only problem I have is that authorization rules are loaded only once.

How can I force declarative authorization to reload the rules from inside a controller action so when I set new permissions to a role it works as I expect?

도움이 되었습니까?

해결책

For those who are trying the same that I'm tried, I had to change the gem a little bit.

Check this commit to see what I did:

https://github.com/bishma-stornelli/declarative_authorization/commit/b508c3c008ed4b72e9fe2ec7802bfafbc6c4590b

Now I can force to reload authorization rules by calling this method:

Authorization::Engine.force_reload

It works fine.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top