RetrievePrincipalAccessRequest req = new RetrievePrincipalAccessRequest();
//specify team or systemuser you want to get privileges for
req.Principal = new EntityReference("team", teamId);
//specify the CRM record you want to check principal permissions for (can be any entity type)
req.Target = new EntityReference("account", accountid);
RetrievePrincipalAccessResponse resp = (RetrievePrincipalAccessResponse)service.Execute(req);
return resp.AccessRights.ToString();
//specify team or systemuser you want to get privileges for
req.Principal = new EntityReference("team", teamId);
//specify the CRM record you want to check principal permissions for (can be any entity type)
req.Target = new EntityReference("account", accountid);
RetrievePrincipalAccessResponse resp = (RetrievePrincipalAccessResponse)service.Execute(req);
return resp.AccessRights.ToString();