why is my CanCan Ability class overly permissive?
问题 I'm (finally) wiring CanCan / Ability into my app, and I've started by writing the RSpec tests. But they're failing — my Abilities appear to be overly permissive, and I don't understand why. First, the Ability class. The intention is that non-admin users can manage only themselves. In particular, they cannot look at other users: class Ability include CanCan::Ability def initialize(user) user ||= User.new # create guest user if needed if (user.has_role?(:admin)) can(:manage, :all) else can(