Rails ACL Using Modified Preorder Tree Traversal
Asked Answered
M

1

10

Is there a Rails ACL plugin/gem that uses MPTT (Modified Preorder Tree Traversal) as the technique to administer permissions?

I'm looking for ACL that will allow me to create roles, assign users to one or many roles, set permissions at the role level and at the user level.

We use CakePHP at the moment and the built in ACL is built using the Tree behavior (which is MPTT). I've read that Rails has acts_as_nested_set which is MPTT. Are there any ACL plugins/gem that utilize acts_as_nested_set?

The biggest thing is that user and role permissions are editable via a GUI (persisted in the database).

Mudslinging answered 1/11, 2011 at 16:9 Comment(1)
Spent few days searching, can't find a gem for implementing permissions tree. Going to do it from scratch, but can't promise it will be a gem.Breezeway
V
0

The Ruby Gem ** ActiveAclPlus ** seems to do what you want:

https://github.com/pschrammel/active_acl_plus

The ActiveAclPlus system consists of access objects, which can be organized by access groups, that request privileges on each other. Allowing or denying access to a privilege is controlled by ACL (access control list entry) objects. Access objects and access groups can be instances of arbitrary ActiveRecord model classes enhanced by acts_as_access_object and acts_as_access_group. They are associated to ACL entries via polymorphic associations.


I personally like the Declarative Authorization Gem a lot - but that does not do tree traversal, but it allows at least inheritance from other rules

Viscose answered 13/4, 2013 at 18:38 Comment(7)
4 years without new commits. This gem is too old.Breezeway
Yes. Not useful for me. I've implemented tree-like permissions from scratch. In combination with traditional plain approach it gives good results.Breezeway
are you planning on making it a gem?Viscose
Not yet. I don't have such amount of free time available.Breezeway
it's pretty straight-forward, see Railscasts.com episodes 303 and 301Viscose
@Breezeway is there anyway you can share the code you wrote? I'd love to take a look.Mudslinging
It is nearly impossible to do. That code is inside closed-source project, and tightly coupled with it's code. It is not just some class that can be easily extracted.Breezeway

© 2022 - 2024 — McMap. All rights reserved.