I attempted to change security roles to make it so that only the opportunity owner can assign ownership of that opportunity. It works, but produces an error every time. I'd be grateful for help eliminating the error below:
Unhandled exception:
Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: {"CallerPrincipal":{"PrincipalId":"c19258a9-f877-e511-80df-3863bb2ec340","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"OwnerPrincipal":{"PrincipalId":"c439fddd-437c-4804-a0dd-692a49fcce0b","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"ObjectId":"43113146-cd7f-e911-a978-000d3a1991fc","ObjectTypeCode":3,"ObjectBusinessUnitId":"50c0b543-5663-e511-80d7-3863bb348e10","OrganizationId":"cb3f92b5-9e54-4f0d-97b7-65decb018df7","EntityName":"opportunity","EntityOwnershipTypeMask":1,"RightsToCheck":"AssignAccess","RoleAccessRights":"None","PoaAccessRights":"None","HsmAccessRights":"None","Messages":["PrincipalHasOwnerPrincipalWithAtLeastBasicPrivilegeDepth = False","EntityUserGroupRights = None","MinimumDepthRequired = Local","GrantedRights = None","SecLib::AccessCheckEx2 failed. Owner Data: roleCount=4, privilegeCount=1569, accessMode=0; Principal Data: roleCount=7, privilegeCount=676, accessMode=0"]}Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>6e4d7efc-9bab-41fc-bb80-7b9316d134ee</ActivityId>
<ErrorCode>-2147187962</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d2p1:key>ApiExceptionSourceKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Plugin/Microsoft.Crm.ObjectModel.CustomBusinessEntityService</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiOriginalExceptionKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Microsoft.Crm.CrmSecurityException: {"CallerPrincipal":{"PrincipalId":"c19258a9-f877-e511-80df-3863bb2ec340","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"OwnerPrincipal":{"PrincipalId":"c439fddd-437c-4804-a0dd-692a49fcce0b","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"ObjectId":"43113146-cd7f-e911-a978-000d3a1991fc","ObjectTypeCode":3,"ObjectBusinessUnitId":"50c0b543-5663-e511-80d7-3863bb348e10","OrganizationId":"cb3f92b5-9e54-4f0d-97b7-65decb018df7","EntityName":"opportunity","EntityOwnershipTypeMask":1,"RightsToCheck":"AssignAccess","RoleAccessRights":"None","PoaAccessRights":"None","HsmAccessRights":"None","Messages":["PrincipalHasOwnerPrincipalWithAtLeastBasicPrivilegeDepth = False","EntityUserGroupRights = None","MinimumDepthRequired = Local","GrantedRights = None","SecLib::AccessCheckEx2 failed. Owner Data: roleCount=4, privilegeCount=1569, accessMode=0; Principal Data: roleCount=7, privilegeCount=676, accessMode=0"]} ---> Microsoft.Crm.CrmSecurityException: {"CallerPrincipal":{"PrincipalId":"c19258a9-f877-e511-80df-3863bb2ec340","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"OwnerPrincipal":{"PrincipalId":"c439fddd-437c-4804-a0dd-692a49fcce0b","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"ObjectId":"43113146-cd7f-e911-a978-000d3a1991fc","ObjectTypeCode":3,"ObjectBusinessUnitId":"50c0b543-5663-e511-80d7-3863bb348e10","OrganizationId":"cb3f92b5-9e54-4f0d-97b7-65decb018df7","EntityName":"opportunity","EntityOwnershipTypeMask":1,"RightsToCheck":"AssignAccess","RoleAccessRights":"None","PoaAccessRights":"None","HsmAccessRights":"None","Messages":["PrincipalHasOwnerPrincipalWithAtLeastBasicPrivilegeDepth = False","EntityUserGroupRights = None","MinimumDepthRequired = Local","GrantedRights = None","SecLib::AccessCheckEx2 failed. Owner Data: roleCount=4, privilegeCount=1569, accessMode=0; Principal Data: roleCount=7, privilegeCount=676, accessMode=0"]}
at Microsoft.Crm.BusinessEntities.SecurityLibrary.AccessCheckEx2(ExecutionContext context, SecurityPrincipal principal, SecurityPrincipal ownerPrincipal, Guid objectId, Int32 objectTypeCode, Guid objectBusinessUnitId, AccessRights rights)
at Microsoft.Crm.BusinessEntities.SecurityLibrary.AccessCheckEx(ExecutionContext context, SecurityAttributes attributes, AccessRights rights)
at Microsoft.Crm.BusinessEntities.CascadeEngine.<>c__DisplayClass47_0.<AssignDB>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.Assign(BusinessEntityMoniker moniker, SecurityPrincipal assignee, ExecutionContext context)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass2_1.<Execute>b__0()</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">ddc9bb1b-ea3e-db11-86a7-000a3a5473e8</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiDepthKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">1</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiActivityIdKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">6e4d7efc-9bab-41fc-bb80-7b9316d134ee</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiPluginSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>{"CallerPrincipal":{"PrincipalId":"c19258a9-f877-e511-80df-3863bb2ec340","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"OwnerPrincipal":{"PrincipalId":"c439fddd-437c-4804-a0dd-692a49fcce0b","Type":8,"IsUserPrincipal":true,"IsTeamPrincipal":false,"TypeName":"user"},"ObjectId":"43113146-cd7f-e911-a978-000d3a1991fc","ObjectTypeCode":3,"ObjectBusinessUnitId":"50c0b543-5663-e511-80d7-3863bb348e10","OrganizationId":"cb3f92b5-9e54-4f0d-97b7-65decb018df7","EntityName":"opportunity","EntityOwnershipTypeMask":1,"RightsToCheck":"AssignAccess","RoleAccessRights":"None","PoaAccessRights":"None","HsmAccessRights":"None","Messages":["PrincipalHasOwnerPrincipalWithAtLeastBasicPrivilegeDepth = False","EntityUserGroupRights = None","MinimumDepthRequired = Local","GrantedRights = None","SecLib::AccessCheckEx2 failed. Owner Data: roleCount=4, privilegeCount=1569, accessMode=0; Principal Data: roleCount=7, privilegeCount=676, accessMode=0"]}</Message>
<Timestamp>2019-05-26T15:45:57.2433538Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
*This post is locked for comments