1

I'm using Sitefinity 10.2.6602.0 and Created Dynamic Module with Module Builder. we have 10 product Records in Module. How to Restrict/Display records as per register user?

Ex: if administration login , we can show all the records in module, if product 1 user login, we need to show only Product 1 record in Module, if product 2 user login, we need to show only Product 2 record in Module.

Note: I verified "permissions" for each record. But unable to hide the records it's showing as read only mode, but as per my requirement we need to completely hide from module.

Please help me how to manage records with simplest way.

piet.t
  • 11,718
  • 21
  • 43
  • 52
Ajay
  • 11
  • 1

1 Answers1

0

You could add a guid field to your product dynamic content type in which you store the id of a Sitefinity role. Then when a user logs in you check which roles they are in and then use some LINQ query to limit to the product which match the user's roles. Now that is assuming that these users are viewing them on a frontend page and you are not trying to use permissions on the backend to hide certain records. If you go with the above option, you will probably want to customize the backend form to edit and create your product dynamic content, so for that special role field you have something like a dropdown to pick from existing roles. You could get more complicated to use an array of guid type in your dynamic content and then allow mapping one or multiple roles to the product item. This could lead to more complicated and slower querying, but would afford more flexibility in the future. Last, another option could be to use the taxonomy capabilities in Sitefinity and then match a name of a tag (or other flat taxonomy) to a role name. Then you could pull items matching those tags for roles that your user in in. Hope that gives a couple of options to work from.