debian-mirror-gitlab/app/serializers/group_link/group_group_link_entity.rb

26 lines
487 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
module GroupLink
class GroupGroupLinkEntity < GroupLink::GroupLinkEntity
include RequestAwareEntity
expose :can_update do |group_link|
can_manage?(group_link)
end
expose :can_remove do |group_link|
can_manage?(group_link)
end
private
def current_user
options[:current_user]
end
def can_manage?(group_link)
can?(current_user, :admin_group_member, group_link.shared_group)
end
end
end