Home

Apr 15, 2010

How to retrieve Roles for User?

System User are related to Roles through SystemUserRoles entity. You can use below fetch Xml to retrieve the roles for a particular user.
<fetch mapping="logical">
<
entity name='role'>
<
attribute name='name'/>
<
attribute name='roleid'/>
<
link-entity name='systemuserroles' from='roleid' to='roleid'>
<
link-entity name='systemuser' from='systemuserid' to='systemuserid'>
<
filter type='and'>
<
condition attribute='systemuserid' operator='eq' value='{50AF398F-7233-DF11-9851-0003FF2B7789}'/>
</
filter>
</
link-entity>
</
link-entity>
</
entity>
</
fetch>

No comments: