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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Manage user type in code
Power Pages
Answered

Manage user type in code

(0) ShareShare
ReportReport
Posted on by 10

How can I in the code manage user type?

For example "if the user is logged in and is an admin user, do this, if he is a power user, do this".

1.png

Categories:
I have the same question (0)
  • Verified answer
    Fubar Profile Picture
    8,501 Super User 2026 Season 1 on at

    https://learn.microsoft.com/en-us/power-pages/configure/liquid/liquid-objects#attributes-18

     

    {% if user.roles contains 'Administrators' %}
    User is an administrator. 
    {% endif %}

     

    To make it secure the target page should also be secured with a web page access control role restricted to the respective Web Role https://learn.microsoft.com/en-us/power-pages/security/page-security

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
omkarsupreme Profile Picture

omkarsupreme 47

#2
11manish Profile Picture

11manish 43

#3
Valantis Profile Picture

Valantis 37

Last 30 days Overall leaderboard