Welcome to mirror list, hosted at ThFree Co, Russian Federation.

member_policy_helpers.rb « concerns « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c4a3caf8bf4b5e99d727e1e23e67a66c75a6817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module MemberPolicyHelpers
  extend ActiveSupport::Concern

  private

  def record_is_access_request_of_self?
    record_is_access_request? && record_belongs_to_self?
  end

  def record_is_access_request?
    @subject.request? # rubocop:disable Gitlab/ModuleWithInstanceVariables
  end

  def record_belongs_to_self?
    @user && @subject.user == @user # rubocop:disable Gitlab/ModuleWithInstanceVariables
  end
end