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

22 lines
453 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
module GroupLink
class ProjectGroupLinkEntity < GroupLink::GroupLinkEntity
include RequestAwareEntity
expose :can_update do |group_link|
2021-10-27 15:23:28 +05:30
can?(current_user, :admin_project_member, group_link.project)
2021-03-11 19:13:27 +05:30
end
expose :can_remove do |group_link|
2021-10-27 15:23:28 +05:30
can?(current_user, :admin_project_member, group_link.project)
2021-03-11 19:13:27 +05:30
end
private
def current_user
options[:current_user]
end
end
end