Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Microsoft SDK Message RetrievePrivilegesRequest returns no privilege in response #614

Closed
SarviH opened this issue May 28, 2024 Discussed in #613 · 4 comments
Closed

Microsoft SDK Message RetrievePrivilegesRequest returns no privilege in response #614

SarviH opened this issue May 28, 2024 Discussed in #613 · 4 comments

Comments

@SarviH
Copy link

SarviH commented May 28, 2024

Discussed in #613

Originally posted by SarviH May 23, 2024
Hello, I have a question about SDK Message RetrievePrivilegesRequest, the RolePrivileges in the response is null when I use the fakeService, I'm sure the privilege is associated correctly because using a fetchXML Query I see the result. here is my middleware builder, am I doing something wrong or it could be a bug ?
MiddlewareBuilder
Thanks for your help in advance

@jordimontana82
Copy link
Owner

Hi @SarviH ,

Thank you for your feedback.

This repo (https://github.com/jordimontana82/fake-xrm-easy) is for v1 of FakeXrmEasy, whereas the sample code you posted is for v2 which has its own repo here:

https://github.com/DynamicsValue/fake-xrm-easy. :)

I see a couple of things in your middleware.

  1. The .Add*() methods should appear before any Use()* methods.

  2. Then, the order of the Use*() methods is important. If you are using pipeline simulation then the .UsePipelineSimulation() call should be called before any other. Here's an example: https://dynamicsvalue.github.io/fake-xrm-easy-docs/quickstart/plugins/pipeline/basics/

  3. There is no need to call .UseMessages() many times, only once should be enough.

  4. You can call .AddFakeMessageExecutors many times, but this is only needed if the FakeMessageExecutors live in different assemblies (dunno if this is the case), otherwise one call is also enough: https://dynamicsvalue.github.io/fake-xrm-easy-docs/quickstart/middleware/

Can you try making these changes and see if that resolves it?

@SarviH
Copy link
Author

SarviH commented May 31, 2024

Hello @jordimontana82 , Thanks for your reply and useful suggestions. Sure I'll check all tomorrow and get back to you.

@SarviH
Copy link
Author

SarviH commented May 31, 2024

Hello @jordimontana82 , I tried some modifications on Middleware here is my code :

RetrievePrivilegeMiddleWareBuilder

but I still have 0 results in privileges, the strange thing is that, the AddPrevilegesRoleRequest is working fine and I see the privilege associated to the user, here is my code :

RetrievePrivilege2

but when I try to use RetrieveUserPrivilegesRequest it returns 0 role privileges, and here is the code :

RetrievePrivilege1

Please let me know if you have any idea about this, thanks in advance :)

@SarviH
Copy link
Author

SarviH commented Jun 13, 2024

Hello dear @jordimontana82 , finally I found out how to resolve this probleme, actually it's not an issue, just need to manipulate the response of the message which is not out of the box in the mock, simply this solved my problem, I'll share here maybe helps the others :)
SolutionForRolePrivilegeFakeXRMEasy
We can close the issue. Thanks again

@SarviH SarviH closed this as completed Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants