Study FAQ
How do I restrict who can execute a Dataverse custom API and which rows it can change?
Also asked as 2
- Which checks actually protect a Dataverse custom API operation and its target row?
- How can I enforce caller and record authorization for a Dataverse custom API?
Answer
Use ExecutePrivilegeName to require an appropriate existing Dataverse privilege, and enforce any additional target-row permissions and business eligibility in the implementation. IsPrivate controls metadata and code-generation discovery. A caller who knows the message can still compose a request, so use the privilege and row checks to protect execution. Dataverse provides no supported way to create a new standalone privilege for this setting. Dataverse custom API privacy and privileges
For an entity-bound release action, validate the target reference, establish the authorized caller and verify that caller may release the chosen request before contacting an Azure dependency or changing state. If the decision relies on a policy read from a configured resource, fail the request when the policy is inaccessible or invalid. Make any elevation deliberate. If the caller is another application, assign its application user the required Dataverse roles in the target environment. That inbound identity is separate from any identity the implementation uses for outbound Azure access. Plug-in execution identity · Manage Dataverse application users
Test an authorized operation, a caller who lacks the execute privilege, and a caller entitled to invoke the message who lacks access to the chosen row. Verify the recorded business state and any outbound work for each case. Dataverse custom API security settings
Full explanation
AB-400: Custom APIs, Business Events and Plug-in Identity
Study guide · AB-400
Read the full explanation