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