+1-888-365-2779
Try Now
More in this section

Forums / Ecommerce / Instantly apply role after purchasing a product

Instantly apply role after purchasing a product

2 posts, 0 answered
  1. Clinton
    Clinton avatar
    14 posts
    Registered:
    27 Feb 2014
    09 Sep 2015
    Link to this post

     Hello Sitefinity,

     Is there any way to instantly apply the role you get after purchasing a certain product? Currently when a user checks out with a product that applies the role, they are required to log out and log back in to actually receive that role and access the secure pages.

    I have tried the following example, however it seems that the method that is overridden is not executed in the correct place:

    http://www.sitefinity.com/developer-network/forums/general-discussions-/programatically-refresh-user-roles#x6UJX7BC5UilD7SL_Psrvg

    Let me know.

    Best Regards,
    Clinton

  2. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    Registered:
    21 Nov 2016
    12 Oct 2015
    Link to this post
    Hello,

    This problem is coming from a missing implementation on our side. You can track the feature request on the following link in order to receive notifications for status updates. 

    What I can suggest is to try to clear the sitemap cache by executing the following static method after you update the user roles (and before the user logs in if you log in the user programmatically):

    Telerik.Sitefinity.Web.SiteMapBase.FlushNodeFiltersCacheForAllUsers();

    This way you can make sure that when the user logs in the sitemap will initialize with fresh and updated data for the current user and will be build based on updated user's permissions and roles which are fetched from the Identity.Roles collection.

    Regards,
    Stefani Tacheva
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered