ripe-article-50191
03/17/2023, 1:14 PMlemon-wall-20836
03/17/2023, 2:28 PMlemon-wall-20836
03/17/2023, 2:28 PMlemon-wall-20836
03/17/2023, 2:33 PMvisible
option to show/hide the fields based on the current_user
lemon-wall-20836
03/17/2023, 2:35 PMlemon-wall-20836
03/17/2023, 2:36 PMruby
field :something, as: :select, options: ["some_options"], visible: ->(resource:) { current_user.is_admin? }
field :something, as: :select, options: ["other_options"], visible: ->(resource:) { !current_user.is_admin? }
ripe-article-50191
03/17/2023, 3:45 PMcurrent_user
ripe-article-50191
03/17/2023, 3:46 PMcurrent_user
in avo.rb initializer and I have the latest version 2.28, launched this week as I remember...lemon-wall-20836
03/17/2023, 3:47 PMAvo::App.current_user
instead?ripe-article-50191
03/17/2023, 3:55 PMripe-article-50191
03/17/2023, 3:55 PMlemon-wall-20836
03/17/2023, 3:57 PMripe-article-50191
03/17/2023, 4:06 PMlemon-wall-20836
03/17/2023, 4:07 PMlemon-wall-20836
03/17/2023, 4:07 PMlemon-wall-20836
03/17/2023, 4:07 PM::Avo::App.context[:user].client?
and ::Avo::App.context[:user].admin?
and see what they returnlemon-wall-20836
03/17/2023, 4:08 PM