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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Hide/Show buttons in p...
Power Pages
Answered

Hide/Show buttons in portal based on Web Roles? Possible? How?

(0) ShareShare
ReportReport
Posted on by 520

What I`m trying to achieve:
All user that are authenticated have the "Authenticated Role", this role gives access to a Request Access button, after an user gets approved, he receives the role "Approved Users", if users have this role, I want to hide some buttons from them. Is it possible?

Categories:
I have the same question (0)
  • PaulJSwider Profile Picture
    152 on at

    Business rules are not supported in Portal so you will have to use .js.

  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    Hi @Robert94 ,

     

    You can use liquid to check if the user has a specific role - see official docs https://docs.microsoft.com/en-us/power-apps/maker/portals/liquid/liquid-filters#has_role. After you find that out you can use js to hide your buttons.

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @Robert94 

     

    As @OOlashyn  mentioned, Please check the official docs and liquid filters which have roles. To be more specific. I have added a sample which is a combination of liquid and JS 

    $(document).ready(function () {
     var roles = "{{ user.roles }}";
     console.log(roles);
     if(roles.contains("Administrators") > 0)
     alert("I am Admin");
    });
    
    

     

    Please use the above sample and find the element id of the button and modify the jQuery. 

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 72 Super User 2025 Season 2

#2
Jerald Felix Profile Picture

Jerald Felix 27

#3
Lucas001 Profile Picture

Lucas001 25 Super User 2025 Season 2

Last 30 days Overall leaderboard