In cancan to be Able to :read all User for exemple we need
can :read,User
to be able to see a specific instance of the user we need
can :read, User do |user|
user == something (condition satisfied ==> ability satisfied)
end
Now my question is : is it possible to check if the user can read at least one instance?? i have a menu where i have to show "users" in the menu if he can at least read one instance of a user otherwise not showing anything
This worked for me:
if User.accessible_by(current_ability,:read) > 0