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 / Application Criteria o...
Power Pages
Suggested Answer

Application Criteria on grid configuration button hid button depending on web role

(0) ShareShare
ReportReport
Posted on by 48
I am trying to implement this https://www.engineeredcode.com/blog/dynamics-365-portal-filter-criteria-and-action-buttonsfor grid configuration button for web roles using fetch xml. This was published in 2019 and at that time it says user permissions was not possible. How would I be able to hide grid configuration buttons depending on web roles? other than using liquid or js.
 
Thanks
 
 
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,926 Super User 2025 Season 2 on at
     
    As of right now today, nothing. You either have to use the OOB ability to customize with JS or Liquid, build your own control or not be able to do it. That was 7 years ago, we can't be expected to keep that (barely worked before anyway) working today. Back when it was Portals (not Power Pages) lol
     
    Sorry you are out of luck if you want something easier. 
     
    Is there a reason you don't want to use Liquid which is simple or Javascript (pretty much as simple)?
     
    I do get an On/Off feature would be nice :-) but it doesn't exist.

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • Suggested answer
    Fubar Profile Picture
    8,455 Super User 2025 Season 2 on at
    Generally speaking the Action options FetchXML filter isn't used with Web Roles, I don't believe it is possible in the FetchXML filter however if it were the Web Role is off the Contact record and the adx_webrole table is only for the Standard model (for the Enhanced Model, there is a different webrole relationship to the Site Component table).
     
    Usually to deal with this limitation there may be several workarounds
    • Create separate Web Pages (for the page that holds the list or subgrid) for each Web Role, and then add a Web Page Access Control Rule (restrict read) for the respective Web Roles to each respective web page.
    • Get the users Web Role using Liquid & set a JavaScript variable, then use JavaScript to remove the respective Action items from the menu.
    • Where possible use Table Permissions, if your table permissions are too broad tighten them up, the Action menu items will only show where the user has the respective table permission to perform the action (e.g. if they don't have edit permissions the edit action will not be present)
    • If using Web Pages (rather than the modal form), use the Target Web Page as a controller, inside it use Liquid If/then or Switch to load different forms based on the Web Role or put an error on the screen.
     
     
    @Michael E. Gernaey having worked with the portal for more than 7 years, I can tell you 98% of things that were valid 7 years ago are still valid now (some things may need adjusting due to the different structure in the Enhanced model).
  • knparksnyc Profile Picture
    48 on at
    @Fubar Thanks for the suggestions.
     
    @Michael E. Gernaey The use of JS was trial and error had to use the got there in the end. 
     
     
    If any one comes across this  and is also trying to disable power pages grid buttons. In the js document ready function use the grid on load function:
     
    $(".entity-grid").on("loaded", function () {
           WebRolesHideBtns(userRoles);
        });
     
    this is the tool tip name that will be the title of the button when in html page, to select the button by title
    const buttonObj = [
     
        "Web Role 1",
       "Web Role 2",
       "Web Role 3"
      ]
    argUR is the web roles argument you get from Liquid
    function WebRolesHideBtns(argUR)
    {
    for (let x of buttonObj)
    {  if( (!argUR.includes(x)))
        $("a[title='"+x+"']").hide();
     
    }
     
     
  • Suggested answer
    oliver.rodrigues Profile Picture
    9,384 Most Valuable Professional on at
    Hi, the List filters actually do take into consideration the Table Permissions settings.
     
    For example, if your action is Create, but the current user does not have create permissions, it will not display the create button.
     
    Is this your scenario? or do you need different pages / actions depending on the Web Role?
     
    Alternatively, the JS is an option, as well as Fubar's suggestion to validate in a separate webpage, rendering the correct form for example

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 63 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 25 Super User 2025 Season 2

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 16 Most Valuable Professional

Last 30 days Overall leaderboard