Skip to content

Commit

Permalink
Removed DisagreedAdmin state
Browse files Browse the repository at this point in the history
  • Loading branch information
eddylynch committed Nov 20, 2024
1 parent b261c9e commit 3cf3129
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ codeunit 7772 "Azure OpenAI Impl"
case PrivacyNotice.GetPrivacyNoticeApprovalState(CopilotCapabilityImpl.GetAzureOpenAICategory(), false) of
Enum::"Privacy Notice Approval State"::Agreed:
exit(true);
Enum::"Privacy Notice Approval State"::Disagreed, Enum::"Privacy Notice Approval State"::DisagreedAdmin:
Enum::"Privacy Notice Approval State"::Disagreed:
begin
if not Silent then begin
CopilotNotAvailable.SetCopilotCapability(Capability);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,4 @@ enum 1563 "Privacy Notice Approval State"
value(2; Disagreed)
{
}

/// <summary>
/// The Privacy Notice was disagreed by the admin.
/// </summary>
value(3; DisagreedAdmin)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ codeunit 1565 "Privacy Notice Impl."
exit("Privacy Notice Approval State"::Agreed);
end;
if PrivacyNotice.Disabled then begin
Session.LogMessage('0000GKE', StrSubstNo(AdminPrivacyApprovalStateTelemetryTxt, "Privacy Notice Approval State"::DisagreedAdmin), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', TelemetryCategoryTxt);
exit("Privacy Notice Approval State"::DisagreedAdmin);
Session.LogMessage('0000GKE', StrSubstNo(AdminPrivacyApprovalStateTelemetryTxt, "Privacy Notice Approval State"::Disagreed), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', TelemetryCategoryTxt);
exit("Privacy Notice Approval State"::Disagreed);
end;

// Admin did not make any decision
Expand Down Expand Up @@ -186,9 +186,6 @@ codeunit 1565 "Privacy Notice Impl."
PrivacyNoticeApproval: Codeunit "Privacy Notice Approval";
begin
if CanCurrentUserApproveForOrganization() then begin
if PrivacyNoticeApprovalState = "Privacy Notice Approval State"::Disagreed then begin
PrivacyNoticeApprovalState := "Privacy Notice Approval State"::DisagreedAdmin;
end;
PrivacyNoticeApproval.SetApprovalState(PrivacyNoticeId, EmptyGuid, PrivacyNoticeApprovalState);
end else begin
if not IsApprovalStateDisagreed(PrivacyNoticeApprovalState) then begin // We do not store rejected user approvals
Expand Down Expand Up @@ -341,7 +338,7 @@ codeunit 1565 "Privacy Notice Impl."
/// <returns>Whether the Privacy Notice was disagreed to.</returns>
procedure IsApprovalStateDisagreed(State: Enum "Privacy Notice Approval State"): Boolean
begin
exit((State = "Privacy Notice Approval State"::Disagreed) or (State = "Privacy Notice Approval State"::DisagreedAdmin));
exit(State = "Privacy Notice Approval State"::Disagreed);
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"System Action Triggers", GetPrivacyNoticeApprovalState, '', true, true)]
Expand Down

0 comments on commit 3cf3129

Please sign in to comment.