locked
Run a popup window with elevated permission in CRM 4.0 RRS feed

  • Question

  • Hi Commumnity,

    I want to run my popup window with elevated permission in CRM 4.0.

    Can anybody suggest how i can achieve this?

    Thanks

    Tuesday, February 8, 2011 12:14 PM

Answers

  • Necessarily you should be careful about how you do this, but the following should work:

    • Build the popup window as an ASP .Net page and follow the normal rules to deploy it within the ISV folder and CrmAppPool application pool
    • Use the 'using new CrmImpersonator()' syntax; this will ensure the code within this block runs in the AD context of the CRM Service account (which is a member of the PrivUserGroup)
    • Rather than using the ExtractCrmAuthenticationToken method, build the CrmAuthenticationToken in code, and explicity set the CallerId to the systemuserid of a user that has the elevated permissions

    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Tuesday, February 8, 2011 8:21 PM
    Moderator

All replies

  • Why do you need elevated permission?
    MSCRM Bing'd - http://bingsoft.wordpress.com
    Check out the CRM 4 to CRM 2011 JavaScript Converter Tool
    CRM Forum Guidance on how to Help Us Help You
    Tuesday, February 8, 2011 12:58 PM
    Moderator
  • Hi,

    The popup window should open with elevated permission and will fetch all the security roles with this permission available in the box.

    Thanks

    Tuesday, February 8, 2011 1:04 PM
  • Necessarily you should be careful about how you do this, but the following should work:

    • Build the popup window as an ASP .Net page and follow the normal rules to deploy it within the ISV folder and CrmAppPool application pool
    • Use the 'using new CrmImpersonator()' syntax; this will ensure the code within this block runs in the AD context of the CRM Service account (which is a member of the PrivUserGroup)
    • Rather than using the ExtractCrmAuthenticationToken method, build the CrmAuthenticationToken in code, and explicity set the CallerId to the systemuserid of a user that has the elevated permissions

    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Tuesday, February 8, 2011 8:21 PM
    Moderator