Hide ribbon buttons on Modern Site Pages and Lists


Dear community,


Disclaimer: I am a SP Admin, but I believe that the solution to the issue I am having requires custom code. Hopefully you can point me in the right direction here. So to the point:


How do I hide default buttons showing in the action ribbon on modern Pages and Lists? My main problem at the moment the button on modern pages called "Send by Email". This button allows any user, even if they have "View Only" permissions to the Page, to search through the entire O365 user database (in the "to-field") and find names of users outside the site collection(!!!) This is very unexpected behaviour of the system in my opinion





We are trying to setup a completely separated site from our main intranet environment to make it available for external users. We want to ensure that there is no association between this site collection and the rest. This has never been an issue in the classic UI as sharing setting for the site collection would stop this from happening (and yes, all the sharing settings are set to the most conservative option). 



Additionally, we are trying to disable Flow and PowerApps buttons in the Modern lists/libraries as MSFT are now pushing them out of preview, which means the all users will have access to two features that they have not yet been introduced to (compliance, training and all that stuff...).




So developers: can you save us or are we doomed?


Thank you in advance

2 Replies
In regards of Flow and PowerApps buttons: Have you tried to disable both services in your tenant / remove licenses to users?

@Juan Carlos González Martín thank you for your reply. Unfortunately that will not help any longer as per this recent article. PowerApps and Flow buttons will show up everywhere now as they are coming out of preview, and they are not conditionally showing/hiding based on licenses. In fact, a trial license will be applied automatically to non-licenses users at the same second as they click that button... Basically, there is no way to stop this except rolling back to classic.


But to be honest, the "Send by Mail" on Site Pages is the thing bothering me even more at the moment. The fact that a user with "read only" access to that specific page and NOTHING ELSE on the whole tenant can use the "to-field" in this feature and get the NAME, TITLE AND EMAIL OF EVERY SINGLE USER ON THE WHOLE TENANT IS JUST INSANE. (Sorry for that)


Thanks anyway