Skip to main content

MGCWardenAuditOperationsService

Custom service for the Evidence & Compliance record actions (audit half, Packages D/E) on the backend test-automation surface. Giving each a menu item is what made an operation writable in the first place. Note that the two are granted in DIFFERENT places, which is the point rather than an oversight: evaluateAuditHealth sits on MGCWardenAuditAdministrationPriv beside the batch it shares an implementation with, and verifyAuditStoreReconstruction on MGCWardenAuditStoreVerifyPriv, which reaches MGCWardenAuditor through its own subtractable duty. Each operation is granted exactly where its menu item is, so the API admits precisely the people the client admits and no others. ORDER OF CHECKS, EVERY OPERATION: transaction level, then the UI-parity grant, then the record lookup. The grant goes BEFORE the lookup on purpose: a caller who could not press the button in the client learns nothing from this surface, not even whether the key they guessed exists. KEYS. Each operation takes the natural key of the record the button acts on, as the data entity exposes it, and returns in RecordKey that record's OData ENTITY KEY TEXT; exactly what goes between the parentheses of GET /data/<Collection>(<RecordKey>); with its RecId in RecordId. Values are single-quoted with embedded quotes doubled; dataAreaId leads for per-company tables and is omitted for shared ones: * catalog row CatalogId='C-01' shared (alternate key CatalogIdx) * pack run dataAreaId='usmf',RunId='PR-0001' per company (MGCWardenAuditPackRunEntity) * purge proposal ProposalId='PP-0001' shared (alternate key ProposalIdx) * deprovisioning entry dataAreaId='usmf',RecordId=5637144576 per company * health alert RecordId=5637144576 shared * leaver intake record dataAreaId='usmf',SourceSystem='HR',SourceReference='L-1' per company (MGCWardenAuditLeaverIntakeEntity) The last two tables have NO natural key; their only indexes are non-unique triage indexes (Status/SlaDate, Reviewed/RaisedDateTime), and neither a user nor a raised-time is unique; so they take RecId, exposed the way MGCWardenEventLogEntity already exposes it: a RecordId field mapped to RecId. The outcome entities for these tables were being added in parallel when this service was written; if they settle on a different key, these two signatures follow them. The key text is built even on Denied (from the caller's input and the session company), which reveals nothing: no lookup has happened at that point. "NOTHING CHANGED" IS REFUSED, NOT COMPLETED. Four of these actions have a path where the client runs to the end without an error and yet moves nothing, reporting it as a warning or an info line (the catalog row is already enrolled; the entry is no longer Proposed; the alert was already reviewed). A client user reads the sentence. A test reads Status; and an operation that asked for one named record to change, and returned Completed when it did not, would pass exactly the assertion it should fail. So each such operation re-reads the record after the action and turns a no-op into Refused, carrying the client's own message plus one line saying what did not change. The action classes stay the authority on WHETHER to act; this service only reports faithfully on WHAT they did. WHAT THIS SERVICE NEVER DOES: enroll straight to Active, submit a register draft on the user's behalf, perform a deprovisioning, bypass the purge's dual control or its export-before-purge refusal, or clear the audit-store evidence behind a health alert. Each of those is a property of the code the client runs, and running that same code is the whole of the parity argument. An API result is an integration output: the caller's harness or log keeps it, beyond the identity vault and beyond erasure. So a message names another person AS THE RECORD STORES THEM, through the display rule and under no disclosure - MGCWardenIdentityVault::display(value, MGCWardenIdentityDisclosure::none()), and for a deprovisioning entry's account and worker MGCWardenDeprovisioningIdentityDisplay::display, which shows an OPEN entry's clear values as stored (Q11, PQ8: the administrator acts on that account) and a decided entry's by the rule: its subject reference, or " (not pseudonymized)" on an entry decided before the upgrade. No API path resolves a reference to a name (design 5.4), so a holder of the identity resolver role reads the reference here as everyone does. Two things stay as they were, by decision: the caller's own user ID (the caller, not another person), and a work-queue claim (AssignedTo, clear by Q11 and shown in clear on the queue beside the same entry), which is never turned into a reference for a message, because printed beside the clear value the caller can read on the queue that reference would be the forward lookup design section 2.5 keeps behind the resolver role.

Methods​

enrollFromCatalog​

Enroll from catalog: creates a DRAFT Sensitivity Register version from one shipped catalog row, exactly as the client's "Enroll from catalog" button does for each marked row. ONE KEY, NOT A SELECTION. The client button is multi-select (MultiSelectionHelper over the form's marked rows); with no form caller the action processes the single _args.record(), which is the path taken here. A test that wants several rows enrolled calls this once per row and gets one Status per row, rather than one aggregate count to parse. DRAFT ONLY, AND NOT SUBMITTED. The action creates Draft register versions and deliberately does not call the activation submit manager (the enrolling person proposes; a different person activates). Nothing here changes that: the created draft captures nothing until it goes through MGCWardenRegisterActivationSubmit and is approved by someone other than its author. An object that already has a Draft, Pending activation or Active version is skipped by the action with a warning; that comes back as Refused (see the class summary). Success is judged by a new Draft version appearing ABOVE the object's highest version before the call; EntryVersion is the action's own monotonic counter (nextVersion), which RecId is not across AOS instances. RecordKey stays the CATALOG ROW's key (the record the button acts on, whose RecId is RecordId); the created draft's register entity key is given in the message in the same OData syntax, WardenAuditRegisterEntries(ObjectName='...',EntryVersion=n), so a test can read it back and hand it to the register activation submit.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is CatalogId='...', RecordId the catalog row's RecId.
NameTypeOptionalDescription
_catalogIdstrNoCatalogId of the sensitivity catalog row.

enrollFromCatalogCounted​

The enrollFromCatalog operation as its service endpoint runs it: runs enrollFromCatalog and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_catalogIdstrNo

attestDeprovisioning​

"Attest access already removed": records that the caller has ALREADY disabled a leaver's account and removed their roles OUTSIDE Warden. IT DEPROVISIONS NOBODY. Read MGCWardenAuditDeprovisioningAttestAction's summary before changing anything here: the whole design of that button is that nobody can mistake a cleared queue for revoked access, and this operation carries the same four safeguards across the API boundary. WHY DIRECT LOGIC, NOT runAction. The action is a RunBase whose main() calls prompt(): a modal dialog that cannot be answered on a service thread. So this operation runs the action's underlying service, MGCWardenAuditDeprovisioning::confirm, behind canRun() on the same menu item, and re-implements the dialog's two guards and run()'s report around it: 1. main()'s refusal of a non-Proposed entry, with the same message. 2. THE TICK-BOX, as _accessAlreadyRemoved. The dialog makes the user change a No to a Yes beside the sentence saying Warden will not do the removal; an affirmation that arrives pre-affirmed affirms nothing. The API equivalent is a separate, explicit boolean that defaults to false when omitted, so a caller who sends only a statement is refused exactly as a user who typed one and left the box unticked. This is the one deliberate addition to the contract's (key, comment) signature, and dropping it would remove the safeguard. 3. The MANDATORY statement stays confirm()'s own rule: a blank one makes confirm() throw before touching state, and that refusal comes back verbatim as Refused. 4. The re-observation: after recording, Warden re-reads the account and says whether it can still see an enabled account or enabled roles. When it can, the result is still Completed (the attestation WAS recorded, and confirm() deliberately does not refuse on a stale read) but the message is the action's blunt warning, not a success line. The report wording mirrors the action's run(); if one changes, change the other.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RecordId=n, RecordId the entry's RecId.
NameTypeOptionalDescription
_recordIdRefRecIdNoRecId of the MGCWardenAuditDeprovisioningEntry (the table has no natural key).
_accessAlreadyRemovedbooleanNoMust be true: the caller states they have already removed this access outside Warden. The API form of the dialog's tick-box; false or omitted is refused. Like the tick-box it is a guard, not a recorded input: it is stored nowhere, and only _attestation reaches the timeline.
_attestationstrNoWhat was removed, where and when. Mandatory.

attestDeprovisioningCounted​

The attestDeprovisioning operation as its service endpoint runs it: runs attestDeprovisioning and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_recordIdRefRecIdNo
_accessAlreadyRemovedbooleanNo
_attestationstrNo

exceptDeprovisioning​

"Except from deprovisioning": a reason-coded withdrawal of a proposed deprovisioning. The access is deliberately RETAINED; nothing about the user's account or roles changes; and the entry stops ageing against its SLA. Direct logic for the same reason as attestDeprovisioning: the action is a RunBase that prompts. This runs MGCWardenAuditDeprovisioning::except behind canRun() on the same menu item, with main()'s refusal of an already-Excepted entry in front of it. The mandatory reason is except()'s own rule (it throws on a blank one before touching state), so its refusal comes back verbatim. A CONFIRMED ENTRY CAN STILL BE EXCEPTED, as in the client: correcting an attestation made in error, or access restored for a rehire. The client's dialog then shows a note that the earlier attestation stays on the timeline and is NOT undone; the API has no dialog, so that note is carried in the result message instead, before the outcome. An entry attested before it is excepted already held the references, and the message then says that Warden cannot see the account from it. SINCE D11 PHASE 4 the account and worker are worded through MGCWardenDeprovisioningIdentityDisplay (see the class summary): an open entry's clear values as stored, an attested entry's references as stored, a legacy decided entry's user id marked "(not pseudonymized)".

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RecordId=n, RecordId the entry's RecId.
NameTypeOptionalDescription
_recordIdRefRecIdNoRecId of the MGCWardenAuditDeprovisioningEntry (the table has no natural key).
_reasonstrNoWhy the access is deliberately retained. Mandatory.

exceptDeprovisioningCounted​

The exceptDeprovisioning operation as its service endpoint runs it: runs exceptDeprovisioning and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_recordIdRefRecIdNo
_reasonstrNo

takeDeprovisioning​

It removes no access and reserves nothing - anybody who can attest or except may still do so (MGCWardenDeprovisioningClaim). RUNS THE MENU ITEM ITSELF, through runAction, because MGCWardenDeprovisioningTakeAction has no dialog - the count workbench's takeCase precedent. What the action does not do is fail LOUDLY: on an entry that is no longer Proposed it warns and returns, and runAction reads a warning as Completed. So the entry is re-read, and a claim that did not happen comes back Refused with the action's own warning and one line saying what did not change. COMPLETED GUARANTEES: the entry is Proposed and AssignedTo is the caller. Taking an entry the caller already holds is Completed too, says so, and writes no second timeline row.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RecordId=n, RecordId the entry's RecId.
NameTypeOptionalDescription
_recordIdRefRecIdNoRecId of the MGCWardenAuditDeprovisioningEntry (the table has no natural key).

takeDeprovisioningCounted​

The takeDeprovisioning operation as its service endpoint runs it: runs takeDeprovisioning and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_recordIdRefRecIdNo

assignDeprovisioning​

It removes no access and reserves nothing. DIRECT LOGIC, NOT runAction, for attestDeprovisioning's reason: MGCWardenDeprovisioningAssignAction is a RunBase whose main() prompts. So this runs what the dialog guards and what run() calls, behind canRun() on the same menu item, in the same order: 1. main()'s refusal of an entry that is not Proposed, with the same message; 2. validate()'s refusal of an assignee who cannot sign in - blank, unknown or disabled - from the same MGCWardenDeprovisioningClaim::assigneeRefusal, so the two cannot disagree; 3. MGCWardenDeprovisioningClaim::assign, then a re-read: an entry attested between the check and the claim's lock claims nothing, and that comes back Refused, not Completed; 4. run()'s warning when the assignee holds no role that can attest or except. The result is still Completed - the assignment WAS recorded - with the warning in the message, exactly as attestDeprovisioning completes with its still-enabled warning.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RecordId=n, RecordId the entry's RecId.
NameTypeOptionalDescription
_recordIdRefRecIdNoRecId of the MGCWardenAuditDeprovisioningEntry (the table has no natural key).
_assignTostrNoThe Dynamics 365 user ID to assign the entry to.

assignDeprovisioningCounted​

The assignDeprovisioning operation as its service endpoint runs it: runs assignDeprovisioning and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_recordIdRefRecIdNo
_assignTostrNo

exportPack​

Evidence pack Export: writes the.txt and.html binders of one Completed pack run to the configured pack export target, through the client's own menu item. Every prerequisite the exporter checks; the Evidence & Compliance feature is on, the run is Completed, 'Pack export target' is configured, the target is writable; is a throw error() in MGCWardenAuditPackExporter::exportRun, so each comes back as Refused carrying the exporter's own message (runAction maps Exception::Error to Refused). An unconfigured target is therefore a Refused a test can assert on, not a Failed. THE PATH IS THE AOS's. PackExportTarget is resolved by System.IO on the server that runs this call, not on the caller's machine; the produced path is in the message.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RunId='...', RecordId the run's RecId.
NameTypeOptionalDescription
_packRunIdstrNoRunId of the evidence pack run (MGCWardenAuditPackRunEntity's key).

exportPackCounted​

The exportPack operation as its service endpoint runs it: runs exportPack and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_packRunIdstrNo

renderPack​

The renderer's four refusals; feature off, run not Completed, no export target, NO ER FORMAT MAPPING; and its two failure paths (ER threw; ER produced no file) are all throw error(), so each comes back as Refused with the renderer's own message. A missing mapping is the expected state on a fresh box and a test can assert on it. Headless-safe as shipped: MGCWardenAuditPackErRenderer calls ERObjectsFactory::createFormatMappingRunByFormatMappingId with two arguments, and that factory's _showPromptDialog defaults to false (verified in the ElectronicReporting source), so ER never tries to show its parameter dialog on this thread. The file lands on the AOS, as for exportPack.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',RunId='...', RecordId the run's RecId.
NameTypeOptionalDescription
_packRunIdstrNoRunId of the evidence pack run (MGCWardenAuditPackRunEntity's key).

renderPackCounted​

The renderPack operation as its service endpoint runs it: runs renderPack and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_packRunIdstrNo

submitPurgeProposal​

"Submit for purge approval": routes one Proposed audit purge proposal into the dual-control purge approval workflow, through the client's own menu item. The submitter only ROUTES; nothing is approved, certified or deleted here. WHAT GOVERNS THE PURGE, AND WHERE, so a test knows which call to expect a refusal from: * Submit (this call) refuses a proposal that is not Proposed, and refuses when the MGCWardenPurgeApprovalTemplate workflow is not configured (MGCWardenSetupGapCheck). That is a second submit, including one made from another company (the proposal table is shared). A proposal stays Proposed while its approval is pending, so only the workflow runtime can tell a second submit from a first. The second signature must therefore come from a DIFFERENT user holding MGCWardenPurgeApprovalPriv, via MGCWardenWorkItemService.approve.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is ProposalId='...' (shared table), RecordId the proposal's RecId.
NameTypeOptionalDescription
_proposalIdstrNoProposalId of the audit purge proposal.

submitPurgeProposalCounted​

The submitPurgeProposal operation as its service endpoint runs it: runs submitPurgeProposal and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_proposalIdstrNo

raiseErasureRequest​

Nothing is restricted or erased here. The action itself refuses a caller without the identity resolver privilege, a value the vault did not issue, a subject already restricted or erased, and a subject with another open request; each comes back as Refused. The reference is the input and the output: no identity is taken or returned.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is SubjectRef='...'.
NameTypeOptionalDescription
_subjectRefstrNoThe subject reference, WP- and twelve characters.

raiseErasureRequestCounted​

The raiseErasureRequest operation as its service endpoint runs it: runs raiseErasureRequest and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_subjectRefstrNo

submitErasureRequest​

The submitter only routes. The approval is a DIFFERENT user's, through MGCWardenWorkItemService.approve: Warden refuses an approver who raised the request (MGCWardenDocumentSoDGate), and at completion restricts the identity and approves or defers the request. Refused for a request that is not Proposed, one that already has an approval workflow, or a subject with another erasure in progress.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is SubjectRef='...' (shared table), RecordId the request's RecId.
NameTypeOptionalDescription
_subjectRefstrNoThe subject reference the request names.

submitErasureRequestCounted​

The submitErasureRequest operation as its service endpoint runs it: runs submitErasureRequest and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_subjectRefstrNo

reviewHealthAlert​

"Mark reviewed": stamps the caller and the time on one unreviewed audit health alert. TRIAGE ONLY; the self-audit store row and the execution exception that record the breach are untouched, exactly as in the client, because this runs the client's own action. The client button is multi-select; with no form caller the action processes the single _args.record(), which is the path taken here; one key, one Status. An alert that was already reviewed is left alone by the action (the original reviewer's stamp stands) and reported as "0 alert(s) marked reviewed"; that comes back as Refused naming who reviewed it and when (see the class summary). Success is judged by re-reading the alert: it must have gone from unreviewed to reviewed by the caller. Since wave A the action stamps ReviewedBy with the caller's subject reference (MGCWardenAuditHealthReviewAction), so the stamp is compared with the session through MGCWardenIdentityVault::sameSubject, which compares references for a stamp written after the cutover and user ids for one written before it. The plain comparison with curUserId() it replaces would never match a reference, and every review the caller DID make would come back Refused. The messages print the stamp as stored, a reference after the cutover - since D11 phase 4 through the display rule under no disclosure (see the class summary), so a stamp written before the upgrade reads " (not pseudonymized)" rather than passing for a reference.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is RecordId=n (shared table, no dataAreaId), RecordId the alert's RecId.
NameTypeOptionalDescription
_recordIdRefRecIdNoRecId of the MGCWardenAuditHealthAlert (the table has no natural key).

reviewHealthAlertCounted​

The reviewHealthAlert operation as its service endpoint runs it: runs reviewHealthAlert and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_recordIdRefRecIdNo

evaluateAuditHealth​

WHY THIS EXISTS ALONGSIDE MGCWardenBatchService.runAuditHealth, which evaluates the same rules through the same method: the two mirror DIFFERENT CLIENT ENTRY POINTS. runAuditHealth is gated on MGCWardenAuditHealthMenuItem, the batch-schedulable item on the System administration menu; this one is gated on MGCWardenAuditHealthEvaluate, the button on MGCWardenAuditHealth. NO RECORD AND NO KEY. The evaluation is estate-wide over the configured rules, so there is nothing to name and RecordKey comes back empty. Rules that breach write MGCWardenAuditHealthAlert rows; the operation reports the infolog the client would have shown.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; Denied when the caller could not press the button in the client.

No parameters.

evaluateAuditHealthCounted​

The evaluateAuditHealth operation as its service endpoint runs it: runs evaluateAuditHealth and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult

No parameters.

verifyAuditStoreReconstruction​

SCOPE IS THE API'S HONEST ANALOGUE OF THE GRID'S FILTERS. The client verifies the rows the operator marked, or everything the grid's current filters select; headless there is no grid, so the caller names a PARTITION and gets exactly that partition, or passes '' for the whole store. Verifying only one row would make the operation a curiosity in the same way the form's own source says it would on the client side. IT CALLS THE ACTION'S LOGIC DIRECTLY RATHER THAN runAction(), which is the documented second path in this service's contract: MGCWardenAuditStoreVerifyAction::main() derives its scope from the calling FORM's datasource, and there is no form here; running it through MenuFunction would silently widen a partition request to the whole store. The gate is unchanged and comes first: canRun() on the same menu item the button runs, Denied before anything is read. A DIVERGENCE IS A FINDING, NOT A FAILED CALL. The action reports divergence through error(), so resultSince() returns Refused carrying that sentence; which is the correct reading for a test: the operation did what it was asked and what it found was bad. Status Completed means "verified, no divergence"; RecordKey echoes the partition asked for.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; Denied when the caller could not press the button in the client.
NameTypeOptionalDescription
_partitionKeystrNoThe store partition to verify, or '' for every row in the store.

verifyAuditStoreReconstructionCounted​

The verifyAuditStoreReconstruction operation as its service endpoint runs it: runs verifyAuditStoreReconstruction and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_partitionKeystrNo

withdrawLeaverIntake​

No account changes and the record is not removed. DIRECT LOGIC, NOT runAction, for exceptDeprovisioning's reason: MGCWardenAuditLeaverIntakeWithdrawAction is a RunBase whose main() prompts. So this runs what main() and the dialog guard and what run() calls, behind canRun() on the same menu item, in the same order: 1. main()'s refusal of a record that has raised or been linked to an entry, or is final, through the same recorder (MGCWardenAuditLeaverIntakeWithdrawal::refuseIfNotWithdrawable), so the refusal is on the record's governance timeline whichever channel was refused; 2. MGCWardenAuditLeaverIntakeWithdrawal::withdraw, which refuses a blank reason (the dialog's validate()) and asks the refusal again under the lock - both come back Refused, verbatim; 3. a re-read: a record that is not Withdrawn afterwards is Refused, not Completed. KEYED ON THE ENTITY'S KEY, source system and reference in the session company, because that is what an HR integration or a test harness holds; RecordKey is the WardenAuditLeaverIntakes key text.

  • Visibility: public
  • Returns: MGCWardenApiResult The result; RecordKey is dataAreaId='...',SourceSystem='...',SourceReference='...'.
NameTypeOptionalDescription
_sourceSystemstrNoThe record's source system.
_sourceReferencestrNoThe record's source reference.
_reasonstrNoWhy the record should not stand. Mandatory.

withdrawLeaverIntakeCounted​

The withdrawLeaverIntake operation as its service endpoint runs it: runs withdrawLeaverIntake and counts the call for Magicite's usage report (MGCWardenApiDispatch::counted).

  • Visibility: public
  • Returns: MGCWardenApiResult
NameTypeOptionalDescription
_sourceSystemstrNo
_sourceReferencestrNo
_reasonstrNo