PL-400 · Question #448
You write a plug-in that creates a row in a custom table. Only some users have permission to create rows in the custom table. You need to allow the plug-in to run for all users by using the principle
The correct answer is A. Initiate the iOrganizationService by passing the ID of a user with permissions to create rows in the. To allow a PowerApps plug-in to create rows in a custom table while adhering to the principle of least privilege, register the plug-in to run with the context of the user who triggered it and ensure that the user has the necessary table and column privileges. For system-level ope
Question
Options
- AInitiate the iOrganizationService by passing the ID of a user with permissions to create rows in the
- BEnsure all users have been granted the Environment Maker role.
- CSet Run in the User's Context to Calling User in the plug-in step.
- DEnsure all users have the Acton Behalf of Another User permission assigned to one of their
How the community answered
(27 responses)- A78% (21)
- B11% (3)
- C4% (1)
- D7% (2)
Explanation
To allow a PowerApps plug-in to create rows in a custom table while adhering to the principle of least privilege, register the plug-in to run with the context of the user who triggered it and ensure that the user has the necessary table and column privileges. For system-level operations where the user's context is insufficient, create a dedicated service account with only the required permissions and use it to run the plug-in [Method 2 below]. Note: In Power Apps, IOrganizationService is an interface that provides programmatic access to the data and metadata within a Dataverse environment, allowing developers to perform operations like creating, reading, updating, and deleting records. It is a key component of the SDK for .NET and is implemented by classes such as ServiceClient, which is recommended for new applications, and is available to plug-in developers via an IOrganizationServiceFactory. Method 2: Use a service account Create a dedicated service user: Create a new user in your Power Platform environment specifically for running the plug-in. Grant minimal privileges: Assign this service user a custom role that has the absolute minimum privileges required to perform the action, such as "Create" and "Read" on the specific custom table and columns. Avoid granting more-powerful roles like "System Administrator, Register the plug-in to run as the service account: When registering the plug-in, specify that it should run under the context of this dedicated service account instead of the user who triggers it. Least privilege: This method is the most secure, as the plug-in can only perform actions that the service account is explicitly allowed to perform, limiting its potential impact. https://learn.microsoft.com/en-us/power-platform/admin/security-roles-privileges
Community Discussion
No community discussion yet for this question.