app/models/ability.rb
def asset_gatekeeper asset_gatekeeper
    can :publish, :all do |item|
      if asset_gatekeeper.is_asset_gatekeeper_of?(item)
        if item.can_manage?(asset_gatekeeper.user) && !item.is_published?
          true
        elsif !item.is_published? && item.is_waiting_approval?(nil, 5.years.ago)
          true
        else
          false
        end
      else
        false
      end
    end
  end
#asset gatekeeper can publish the assets belonging to their project if as well can manage or the item is waiting for his approval
asset gatekeeper can publish the assets belonging to their project if as well can manage or the item is waiting for his approval
asset gatekeeper can publish the assets belonging to their project if as well can manage or the item is waiting for his approval
def asset_gatekeeper asset_gatekeeper
    can :publish, :all do |item|
      if asset_gatekeeper.is_asset_gatekeeper_of?(item)
        if item.can_manage?(asset_gatekeeper.user) && !item.is_published?
          true
        elsif !item.is_published? && item.is_waiting_approval?(nil, 5.years.ago)
          true
        else
          false
        end
      else
        false
      end
    end
  end
def asset_gatekeeper asset_gatekeeper can :publish , :all do | item | if asset_gatekeeper . is_asset_gatekeeper_of? ( item ) if item . can_manage? ( asset_gatekeeper . user ) && ! item . is_published? true elsif ! item . is_published? && item . is_waiting_approval? ( nil , 5 . years . ago ) true else false end else false end end end
asset gatekeeper can publish the assets belonging to their project if as well can manage or the item is waiting for his approval
asset gatekeeper can publish the assets belonging to their project if as well can manage or the item is waiting for his approval
asset_gatekeeper