Hi @Erandi ,
It seems that you need to hide the pages ,after few condition in Power pages.
There is OOB ways that Microsoft have been provided in Power pages portal.
The following steps outline how to configure page permissions to restrict access to a specific page.
- Sign in to Power Pages.
- Select your site, and then select Edit.
- In the page navigation, select the ellipses (...) to the right of a page, and then select Page settings.
- In the side tab, select Permissions.
- Select I want to see who can view this page.
- In the list, select the Authenticated Users web role

Output:-

In addition to this, you can modify the visibility conditions on the header web template according to your specific requirements.
Below, I have hide the web links based on web roles. If the user is authenticated, then the first web link set (home) is hidden.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
var usersRol = '{{user.roles}}';
console.log(usersRol);
alert("test2");
if(usersRol.includes("Authenticated")){
var containerr = $(".container")[0]; // Change the value of [] according to your web link set
$($(containerr).find(".weblink")[0]).hide();
}
// Your existing code goes here
</script>

You can refer to the provided forum question for further guidance.
https://powerusers.microsoft.com/t5/General-Discussions/How-to-hide-Main-Navigation-in-power-pages-portal/td-p/2584218
Thanks!
Inogic Professional Services
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/