web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

constructor parameters in Plugin development

(0) ShareShare
ReportReport
Posted on by 2

Do we need to imposonate calling user in order to read Secure configuration in Plugin development.

Can both secure and insecure be accessed by any user inside plugin(code).

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Secure configuration parameters can only be viewed by CRM/D365E Administrators, whereas unsecure can be viewed by any user of the application.

    Hope this helps.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    You should be able to read if you will run your plugin on Admin user, but never tested it.

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Hi Lathin,

     I am pretty sure both secure and unsecure configuration will be available in the plugin constructor no matter what the role is. However, as a regular user you won't be able to read secure configuration values using fetchxml, for example (in other words, your plugin will have access to its configuration - those are the values passed to the constructor. But, if you decide to run a query from within the plugin to access secure configuration records, that might or might not work depending on the user roles)

  • Goutham A Profile Picture
    2 on at

    Thanks Alex.

    I just need to confirm if they are available in plugin constructor for any logged in user(our plugin runs as loggedin user's context). I just want to retrieve values in secure config in plugin constructor.

  • ashlega Profile Picture
    34,477 on at

    Never had a problem with that. Just keep in mind secure configuration won't be included into your solutions.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Lathin,

    Secure configuration won't be accessible  from constructor if the calling user context user not having System Administrator role . So in that case plugin should be impersonate with some system admin user context . Hope this helps.

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Come on guys.. it takes 5 minutes to try.

    It will be accessible in the constructor.

  • Goutham A Profile Picture
    2 on at

    Thanks Alex. i already tried and i am able to access in constructor.(for 2-3 roles, other than system admin i tested). I believe accessing in constructor will not be an issue as you said.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans