summaryrefslogtreecommitdiff
path: root/app/policies/releases/source_policy.rb
blob: 8b86b9255899f2e344df18677f7bfa5614d4a7cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module Releases
  class SourcePolicy < BasePolicy
    delegate { @subject.project }

    rule { can?(:public_access) | can?(:reporter_access) }.policy do
      enable :read_release_sources
    end

    rule { ~can?(:read_release) }.prevent :read_release_sources
  end
end