CRM 2011 CS: Sharing Records in CRM 2011

// Create the request object and set the target and principal access
GrantAccessRequest grantRequest = new GrantAccessRequest()
            {
                Target = new EntityReference(Account.EntityLogicalName, accountId),
                PrincipalAccess = new PrincipalAccess()
                {
                    Principal = new EntityReference(SystemUser.EntityLogicalName, userId),
                    AccessMask = actionRights
                }
            };


 // Execute the request.
GrantAccessResponse granted = (GrantAccessResponse)service.Execute(grantRequest);