I have SharePoint online site I need to hide SP ribbon
based on user permission.
Should not change the master page code.
anyone suggest me to achieve this or creating the new control to inject in all pages.
I have SharePoint online site I need to hide SP ribbon
based on user permission.
Should not change the master page code.
anyone suggest me to achieve this or creating the new control to inject in all pages.
For classic view, you could add custom script link for this requirement.
Connect-PNPOnline -Url https://xxx.sharepoint.com/sites/xxx/
Add-PnPJavaScriptLink -Name "hideNavigationBasedonGroup" -Url /sites/xxx/SiteAssets/yourJShideribbon.js -Sequence 9999 -Scope Site
You could find the script here