Posts

Showing posts from May, 2022

Disable list view selection for users on SharePoint Online using SPFx Application Extension

Image
 Recently we ran into an issue on SharePoint Online that user should be able to see only their records in a list and not otehrs. So we had updated the default list view filter with Employee equal to [Me].  We have also created a view "Admin" with no filter so admins can see all records. However, the view selection is still enabled as they have View permission and hence the users can switch to Admin views and see all records, see below screenshot: So to solve this issue, we created a very simple SPFx Application customizer extension such that it hides the entire list comand bar for normal users, and shows it for only site admins. See the end result for Site admins and Normal users: Open the node.js command prompt and start eith the yeoman scaffolding: Select the type of client-side component as Exension Select the type of extension to be Application Customizer Open the solution in VS Code Create a new CSS file in this path: src > extensions > appExtensionDemo > mysty