@Fubar Thanks for the suggestions.
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();
}