app/models/ability.rb
def asset_housekeeper asset_housekeeper
    can [:manage_asset, :delete, :edit, :download, :view], :all do |item|
      asset_housekeeper.is_asset_housekeeper_of?(item) &&
        item.managers.map { |manager| (item.projects - manager.person.former_projects).none? }.all?
    end
  end
#asset housekeeper can manage the assets belonging to their project
asset housekeeper can manage the assets belonging to their project
asset housekeeper can manage the assets belonging to their project
def asset_housekeeper asset_housekeeper
    can [:manage_asset, :delete, :edit, :download, :view], :all do |item|
      asset_housekeeper.is_asset_housekeeper_of?(item) &&
        item.managers.map { |manager| (item.projects - manager.person.former_projects).none? }.all?
    end
  end
def asset_housekeeper asset_housekeeper can [ :manage_asset , :delete , :edit , :download , :view ] , :all do | item | asset_housekeeper . is_asset_housekeeper_of? ( item ) && item . managers . map { | manager | ( item . projects - manager . person . former_projects ) . none? } . all? end end
asset housekeeper can manage the assets belonging to their project
asset housekeeper can manage the assets belonging to their project
asset_housekeeper