Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Get user permissions for an Entity Via javascript

(0) ShareShare
ReportReport
Posted on by 4

I have an HTML page that appears on my contact form.

It is a custom entity that not everyone with the ability to open contact have permission to.

What I need to do is on page load check that the current user has at least read permissions to the custom entity and if they do load the HTML.

If they don't then leave the HTML off the page.

I know there is a function in Power Apps for this, but I am still using legacy forms and will be for a while. Too much customization to change.

I cannot believe I am the first to need this functionality.

Thanks Brian

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Get user permissions for an Entity Via javascript

    Hello,

    In this case, I would recommend using WebApi to query that data and check the level of privileges.

  • CU02122005-1 Profile Picture
    4 on at
    RE: Get user permissions for an Entity Via javascript

    This does not work in my environment. I am using legacy forms not the Power Apps forms.

    userSettings.getSecurityRolePrivilegesInfo().then(successCallback, errorCallback);

    Tells me getSecurityRolePrivlegesinfo is not a function.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Get user permissions for an Entity Via javascript

    Please, review the document. This is exactly what you need:

    pastedimage1669755574430v1.png

    The other thing that you will have to dig to the particular privilege but that's what you need. Good luck.

  • CU02122005-1 Profile Picture
    4 on at
    RE: Get user permissions for an Entity Via javascript

    That gives me the Role for the current user, but I need to know whether or not a user has minimum read access for a specific entity.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Get user permissions for an Entity Via javascript

    Hello,

    This is how you can do it - learn.microsoft.com/.../usersettings

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans