ACL that requires multiple sids #3
Replies: 3 comments 5 replies
-
|
I had a similar situation in my app. Ended up solving it the following way: [group_1, group_2].each do |group|
authorizer.authorize(current_user, group, :write)
endAn approach with SIDs concatenation can work, but it's fragile. E.g. a user has 2 required groups + 1 more. Or an order of groups could be different. This kind of use-case is better handled on a level above ACL. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the quick reply. That makes sense, although if I wanted to use scope with this complexity I am guessing that I would need to build that into the where clause? |
Beta Was this translation helpful? Give feedback.
-
|
So you can do so, by setting a dry-effect at the rack level, which will wrap all the inner dry-effects |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a requirement where I need an allow to take multiple sids to be present e.g. you need to be a member of 2 groups to approve a change (the change impacts items of both groups)
I can concatenate the sids in the allow as below
e.g.
acl.allow "[group:1,group:2]"Is this the approach you have taken?
Beta Was this translation helpful? Give feedback.
All reactions