2021-01-22 12:08:52 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module GroupLink
|
|
|
|
class ProjectGroupLinkEntity < GroupLink::GroupLinkEntity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
|
|
|
expose :can_update do |group_link|
|
2021-08-19 00:11:16 +00:00
|
|
|
can?(current_user, :admin_project_member, group_link.project)
|
2021-01-22 12:08:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
expose :can_remove do |group_link|
|
2021-08-19 00:11:16 +00:00
|
|
|
can?(current_user, :admin_project_member, group_link.project)
|
2021-01-22 12:08:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def current_user
|
|
|
|
options[:current_user]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|