You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be a nice feature to have if_true in a #has_permission_on block, to check conditions of dynamic parameters that have to be met for the user to meet the privileges in this block. This would be especially useful on new, where no attributes are known yet.
E.g:
role :login do
includes :guest
# -- Document
has_permission_on [:documents], :to => [:manage, :view] do
if_attribute :folder_id => is_in { Folder.get_folder_ids_permitted(
user, [:root, :admin, :update]) }
end
has_permission_on [:documents], :to => :view do
if_attribute :folder_id => is_in { Folder.get_folder_ids_permitted(
user, :read) }
end
has_permission_on [:documents], :to => :new do
if_true {Folder.has_roles_anywhere?(user, [:root, :admin, :update]) }
end
end
The text was updated successfully, but these errors were encountered:
It seems that this could solve my use case as well. I figure that I already have access to user, and should thusly be able to access a boolean on said user.
My use case is checking a boolean on the actual user:
if_true user.configurable_setting_boolean?
or
if_true user.company.configiruable_setting_boolean?
It would be a nice feature to have if_true in a #has_permission_on block, to check conditions of dynamic parameters that have to be met for the user to meet the privileges in this block. This would be especially useful on new, where no attributes are known yet.
E.g:
The text was updated successfully, but these errors were encountered: