Current filter:
          You should refresh the page.
          Not Logged In

          Store Model Differences in Database Using Complex Security

          0
            • I'm using complex security for my application and I would like to use the functionality from your Store Model Differences in Database example but can't fathom what changes are needed to make it work. Can you provide an example using complex security or provide me with some guidance on what changes are necessary please.

          0

          Hello Terence,

          Thank you for contacting us.
          I am afraid we do not have a ready example demonstrating the use of complex security together with storing model differences in the database solution.
          However, it is easy to modify the How to manage user settings (reset, merge, import, export, etc.) stored in the database instead of a file system example to support your scenario.
          To do this, please download the example and do the following:
          1. Use the Complex Security component instead of SecuritySimple. Refer to the http://documentation.devexpress.com/#Xaf/CustomDocument2768 help article for more details.
          2. Use the User class instead of the SimpleUser class in classes used in the example.
          I hope you find this information helpful. Otherwise, please provide us with a modified version of E968, showing what you have implemented and what did not work. We will be happy to assist you further.

          Thanks,
          Dennis

          0

          Dennis, I've already looked at topics in your suggestions well before submitting this question. If I had found them helpful for this case the question wouldn't even have been posed.

          The biggest problem appears to be in MySecuritySimple.vb (renamed MySecurityComplex.vb in the attachment) and ImportExportUserDifferencesController.vb UpdateActivity subroutine because when I used the User class in lieu of SimpleUser class there isn't an IsAdministrator property. I've tried to work around it but being new to DevExpress I'm uncertain of how to determine the role of the current user and while I did find what I've used in the Logon and UpdateActivity subroutines from searches I can't seem to get it to work.

          I'm sure there is a need for this example based on Complex Security as I'm sure most developments for corporate clients aren't going to use Simple Security.

          I can't upload my changes to the project because it exceeds the file size limit but I've attached to the two files in question.

          UserDiffsToDB.Module.zip
          0

          Hello Terence,

          Thank you for the feedback. In fact, you do not need MySecurityComplex if you do not use an Administrator mode. The same applies to the controller you tried to modify. So, if you omit these two parts, the rest will operate as expected.

          If you need more information, the How to perform some actions only if the currently logged User belongs to a certain Role should help you determine the role of the current user.

          I agree with you that it would be great to have a Complex Security-based version of this example by default.
          We will need some time to implement this example. I have created a corresponding suggestion for that: Documentation - Provide a Complex Security-based version of the E968 example.

          See Also:
          Support - provide an example showing how to edit model user differences if they are stored in the database ( K18137 )
          Core - Provide an easy way to set the method of storing default and user model differences

          Thanks,
          Dennis

          0

          I certainly am using an Administrator role, don't be misled by the code I sent, it is not from my application, it was from the DevExpress example with some modifications I made trying to get it to work for Complex Security. I doubt that I'll have much use for Simple Security in any application I need to build for clients, perhaps for some I might build for my hobby but that would be about it. I'll have a look at "How to perform some actions only if the currently logged User belongs to a certain Role" but the other links provide no new information.

          However, thank you for adding my question as suggestion, I look forward to seeing the outcome.

          I'm hoping to see a second phase to my application later in the year so I will delay the model differences issue until then and hopefully your amended example will be available. No time for this phase which is due for completion in the middle of this month.

          0

          Hello Terence,

          Thank you for the feedback. Attached is SecurityComplex-based version of the example. I hope you find it helpful.
          We will update our docs and example later.

          Thanks,
          Dennis

          dxSampleQ341530.zip
          0

          Thanks Dennis, exactly what I was after.

          0

          Hi Terence,

          Thank you for the feedback. I am glad to hear that this example meets your business needs. Please do not hesitate to contact us in case of any further difficulties.

          Thanks,
          Dennis

          =================================
          Join the XAF and XPO Fan Club!
          =================================

          You must  log in  or  register  to leave an answer