SOLVED

A question about permissions in SPFX

Iron Contributor

Hi,

 

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

Americo

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. 

Thanks!

 

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

 

Regards

Americo

Hi @Americo Perez

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

https://sharepoint.github.io/sp-dev-fx-controls-react/controls/SecurityTrimmedControl/

 

If you are new to PnP reusable controls, you can find the information to get started here: https://sharepoint.github.io/sp-dev-fx-controls-react/

 

Hope this helps :)

Thanks Joel,

 

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

 

Best regards

Americo

best response confirmed by Americo Perez (Iron Contributor)
Solution

Sure @Americo Perez

 

You can start here:

https://docs.microsoft.com/en-us/sharepoint/dev/community/community

 

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.

 

cheers,

Joel

 

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

Americo

1 best response

Accepted Solutions
best response confirmed by Americo Perez (Iron Contributor)
Solution

Sure @Americo Perez

 

You can start here:

https://docs.microsoft.com/en-us/sharepoint/dev/community/community

 

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.

 

cheers,

Joel

 

View solution in original post