Unable to retrieve previliges of user
-
Tuesday, December 11, 2012 7:09 PM
Hi All,
I want to retrieve all previliges of user(Sales Person). Using below code I am able to retrieve previliges but not all previliges of Sales Person role. But when I give role as system admin to user then he is able to retrieve all previliges.
Please confirm where i am wrong or what needs to mention in code.
-Anand
RetrieveUserPrivilegesRequest requser = new RetrieveUserPrivilegesRequest();
requser.UserId = new Guid(userID);
RetrieveUserPrivilegesResponse resp = (RetrieveUserPrivilegesResponse)_service.Execute(requser);
foreach (RolePrivilege priv in resp.RolePrivileges)
{
}
All Replies
-
Wednesday, December 12, 2012 2:49 AMCould you post the code you're using the get the user's guid? I'm guessing you already verified it but it's worth verifying just to be 100% sure you are referencing the exact user - you cna also just fire the user id against the UserIsInRole just to make sure they come back verified http://www.resultondemand.nl/support/sdk/4a4da7b8-ca42-4f03-9a27-83d487d38ace.htm
Cordially, W.G.Ryan - www.williamgryan.mobi
-
Wednesday, December 12, 2012 1:08 PMModeratorWhat privileges do you not retrieve that you expect to retrieve for the Sales Person role ?
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
-
Friday, December 14, 2012 7:00 PM
Hi All,
I got the solution. RetrieveUserPrivilegesRequest will retrieve only privileges which is directly related to user i.e privileges from roles which is directly assigned to user not through team.
In my case user is related to specific Team and this method is not retrieving privileges of team for user.
for solution, i checked whether user is member of team or not then using RetrieveTeamPrivilegesRequest I retrieved team privileges.
Thanks everybody.:)
- Marked As Answer by Anand Wani- CRM Friday, December 14, 2012 7:00 PM
- Edited by Anand Wani- CRM Friday, December 14, 2012 7:00 PM