C# Code to Find Security Roles which use a Specific Privilege
- D365 Freelancer
- Aug 26, 2018
- 1 min read
Updated: Jun 8, 2023

The other day I was debugging a security error and I wanted to find which security roles implemented a specific privilege.
Normally I would use the Privileges Discovery plugin in the Xrm Toolbox however the plugin was not working.
My solution! I wrote the below early bound code to find the security roles that the specific privilege used. Below is the code, please feel free to reuse it as needed.
Comentários