Rails 4: CanCanCan abilities with has_many :through association
问题 I have a Rails app with the following models: class User < ActiveRecord::Base has_many :administrations has_many :calendars, through: :administrations end class Calendar < ActiveRecord::Base has_many :administrations has_many :users, through: :administrations end class Administration < ActiveRecord::Base belongs_to :user belongs_to :calendar end For a given calendar , a user has a role , which is define in the administration join model. For each calendar, a user can have only one of the