Base solution for your next web application
Open Closed

Logged in user(useraccount)based data filtering for entities #4607


User avatar
0
gayan created

Hi, I want to filter the data showed, based on the logged-in user (user account). I saw the documentation in the DataFilters section and writing the IHasPerson interface. So, maybe I’ll need something like IHasUserAccount. Is this the right approach? If you can explain how to write this based on the phonebookdemo application it would be very helpful. E.g. The phonebook will only show the entries made by the logged-in user. The person entity is filtered. Thanks for the support.


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Gayan,

    Is your entity derives from CreationAuditedEntity or FullAuditedEntity ? If so, you can directly use ICreationAudited interface. If this is only for one entity, you can directly make the filtering in your application service.

  • User Avatar
    0
    gayan created

    Hi @ismcagdas, Yes, I am using a FullAuditedEntity. At the moment I am trying with one entity. Can you please explain more, may be with a sample code. I tried and it did not filter. The project is a dot net core project.