diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-04 04:59:37 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-04 04:59:37 +0300 |
commit | f9e849c076efb3162a3d951d8aae2e7be3e574f4 (patch) | |
tree | 8593f390302635cdfab2e733b305ee01f59bb885 /app/models/concerns/protected_tag_access.rb | |
parent | 3bb3a6886f3b206a2ec089d6b1e8854615daa0b8 (diff) |
Cleaned up duplication with ProtectedRefAccess concern
Diffstat (limited to 'app/models/concerns/protected_tag_access.rb')
-rw-r--r-- | app/models/concerns/protected_tag_access.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/app/models/concerns/protected_tag_access.rb b/app/models/concerns/protected_tag_access.rb index cf66a6434b5..9b7d31a6fd5 100644 --- a/app/models/concerns/protected_tag_access.rb +++ b/app/models/concerns/protected_tag_access.rb @@ -2,20 +2,9 @@ module ProtectedTagAccess extend ActiveSupport::Concern included do + include ProtectedRefAccess + belongs_to :protected_tag delegate :project, to: :protected_tag - - scope :master, -> { where(access_level: Gitlab::Access::MASTER) } - scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) } - end - - def humanize - self.class.human_access_levels[self.access_level] - end - - def check_access(user) - return true if user.is_admin? - - project.team.max_member_access(user.id) >= access_level end end |