2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Groups
|
|
|
|
module GroupLinks
|
2023-03-04 22:38:38 +05:30
|
|
|
class UpdateService < ::Groups::BaseService
|
2020-03-13 15:44:24 +05:30
|
|
|
def initialize(group_link, user = nil)
|
|
|
|
super(group_link.shared_group, user)
|
|
|
|
|
|
|
|
@group_link = group_link
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute(group_link_params)
|
|
|
|
group_link.update!(group_link_params)
|
|
|
|
|
|
|
|
if requires_authorization_refresh?(group_link_params)
|
2021-09-30 23:02:18 +05:30
|
|
|
group_link.shared_with_group.refresh_members_authorized_projects(blocking: false, direct_members_only: true)
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
attr_accessor :group_link
|
|
|
|
|
|
|
|
def requires_authorization_refresh?(params)
|
|
|
|
params.include?(:group_access)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|