debian-mirror-gitlab/app/policies/concerns/member_policy_helpers.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
449 B
Ruby
Raw Normal View History

2023-01-13 00:05:48 +05:30
# 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