Hi all,
as mentioned in the post about Tachiban, I released the authorization gem as well. Rokku 2.0.0 can now be used with Hanami 2.3 appsl.
Hi all,
as mentioned in the post about Tachiban, I released the authorization gem as well. Rokku 2.0.0 can now be used with Hanami 2.3 appsl.
Thanks for releasing this, Sebastjan! As the authorization gem I was using for my project apparently became unmaintained, I took a look at this today. This was, admittedly, very superficial look, but here’s some feedback/questions:
lock? method in the policy for Lock action?authorized?, not necessarily a user, but then it’s automatically converted to just the list of roles inside the policy. Is there a way to provide some wider context? Or maybe you consider this out of scope of Rokku (which is fine too)?Hi Paweł,
thank you for checking out Rokku and thank you for the feedback.
It’s quite embarrassing that I left out the policy file out of the documentation, given that it’s the basis for the functionality. I apologize. I’ll push a fix for that, but I’ll go over everything again first, just to be sure it’s all there. I was pressed for time, I needed 2.0 for my current app and I apparently released too soon; not an excuse, just the reason
.
Non-CRUD actions should work, Rokku is just testing against the namespace as it is, so adding lock? for Lock action would work. I have StatisticsReport::Index, but there so no real CRUD going on, I could have just used StatisticsReport::Report.
Maybe I could change the generator to allow for these scenarios:
Or a more simpler approach of:
As for more fine-grained approach, I agree. Rokku should be enhanced. The current scope of functionality is a reflection of my current requirements. I did try out the approach you suggest in the past (0.5.1 I believe) with is_author?(object) so then I could do authorized?(@controller_name, @action_name) && is_author?(@task).
I would like to revisit this and provide more granular approach. I’ll try to do this in the scope of my current application I’m working on and prepare a proposal. Of course any suggestions are most welcome
.