A question about permissions in SPFX

Regular Contributor



Is it possible to set permissions to a web part written i SPFX? 

I mean, say I have a webpart that render a calendar, is possible to allow a specific SharePoint group to see the web part and hide it from the users that are not in the group? 


Best regards


6 Replies

As far as I know there is no way to hide a certain SPFx-based WebPart based on permissions to prevent users adding it to a page. You could check for permissions in your WebParts logic which makes it possible to alter the way your WebPart appears or behaves at runtime. 



Do you have some link where I can see how it can be done?




Hi @Americo Perez

The Security Trimmed Control from PnP Reusable Controls should be what you are looking for


If you are new to PnP reusable controls, you can find the information to get started here:


Hope this helps :)

Thanks Joel,


Do you have link to PnP in general? I am new to PnP :) 


Best regards


best response confirmed by Americo Perez (Regular Contributor)

Sure @Americo Perez


You can start here:


I would extremely recommend that you join the community calls (calendar invites on the link) as you learn all the latest updates and have the chance to see some really great demos. Really worth the time of you can make it.


There is also a youtube channel with lots of useful videos and recording from previous calls


On top of that, you also have lots and lots of project samples, reusable projects and frameworks under the GitHub repository!

Links to all of this available from the initial page, but let me know if you need any help to find something.





Thanks a lot @Joel Rodrigues !


I will check the link and the information there.


I will send you some messages if I feel that something isn't clear enough form me.


Best regards