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

Forums / Developing with Sitefinity / Event Hub: Identifying the Originating Request

Event Hub: Identifying the Originating Request

3 posts, 1 answered
  1. S. Webb
    S. Webb avatar
    36 posts
    Registered:
    28 Dec 2006
    04 Sep 2014
    Link to this post

    Hi,

     I'm using the EventHub events RoleAssigned and RoleUnassigned in some custom integration code to sync user data from Sitefinity to another system.

    When I update a role for a user through my integration code the event fires and when I update a role for a user in Sitefinity the event fires.

     Is there any way to determine where the originating request to Assign/Unassign a role came from, my custom code or from the Sitefinity UI?

     Thanks,
    Steve

  2. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    09 Sep 2014
    Link to this post
    Hello Steve,

    Unfortunately the eventInfo does not carry such information, so I would suggest to use the UrlReferrer in order to determine where from the request is coming form. 

    var source = HttpContext.Current.Request.UrlReferrer.AbsolutePath

    This way you can get the page from which this has been invoked.

    Regards,
    Pavel Benov
    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
     
    Answered
  3. S. Webb
    S. Webb avatar
    36 posts
    Registered:
    28 Dec 2006
    09 Sep 2014 in reply to Pavel Benov
    Link to this post

    Thanks Pavel,

    That is what I am using now but I was hoping for a more graceful method.

    Thanks again,
    Steve

3 posts, 1 answered