I got this exception: "Support user does not have permission on this operation" when I try to give access to a record for a user. this is my code:
public void GrantAccess(Guid targetId, Guid principleId) { using (var serviceProxy = new OrganizationService(ConStr)) { IOrganizationService service = (IOrganizationService)serviceProxy; var request = new GrantAccessRequest() { Target = new EntityReference(Account.EntityLogicalName, targetId), PrincipalAccess = new PrincipalAccess() { AccessMask = AccessRights.ReadAccess, Principal = new EntityReference(principleId.ToString()) } }; service.Execute(request); }
and my Constr is like:
private static readonly string ConStr = "Url=http://crm.[ourdomain].com:90/Test; Domain=[ourdomain]; Username=[user]; Password=[password];";
I cand read the data, for example I get this method: RetrieveSharedPrincipalsAndAccessResponse even more I "RevokeAccess" by RevokeAccessRequest, but I couldn't Grant access or modify it.
*This post is locked for comments