I have a Organization model and i want to authenticate it based on the role of the user i.e. admin and superadmin. When i am logged in as admin there should not be Organization model on the list and CRUD operation for it also should not work but when logged in as superadmin it should work fine.
Also i tried to hide the Organization model in rails admin based on user role but it is showing the following error:
I don't know much about the rails admin configuration so i might be wrong about the way i am trying to hide the model. So is there is any other way to do it and also a better solution to authenticate the model based on user role ??
User.rb
enum role: [:admin, :superadmin]
Rails 6.0.1
rails_admin 2.0
rails_admin relies on cancancan for authorization, use that.