Skip to content

Instantly share code, notes, and snippets.

@AshV
Last active April 12, 2023 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshV/287c55d6621adf9d29db159f786fd86a to your computer and use it in GitHub Desktop.
Save AshV/287c55d6621adf9d29db159f786fd86a to your computer and use it in GitHub Desktop.
FetchXml query to list all Security Roles assigned to Current/LoggedIn user.
<fetch>
<entity name="systemuser">
<filter>
<condition attribute="systemuserid" operator="eq-userid"/>
</filter>
<link-entity name="systemuserroles" from="systemuserid" to="systemuserid">
<link-entity name="role" from="roleid" to="roleid" alias="AssignedRole">
<attribute name="name"/>
</link-entity>
</link-entity>
</entity>
</fetch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment