-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-script-editor - Can this webpart be updated to include the Audience Targeting feature? #5223
Comments
@stormanh I assume you want to target the web part to uses/groups, not the List/Library audience targeting feature? Or something similar to using SharePoint security groups like this example https://rabiawilliams.com/spfx/spfx-react-targetaudience/? To phrase, you want to target some audience, not use SharePoint audience feature? And you would like:
|
@wobba That is correct. Allow specified: Thank you! |
I have working code and will check it in next week most likely. Was a fun thing to do, and likely useful for many SPFx projects. I also added some caching to reduce API calls. Made it cache by the hour, with a default 24h. Which means it would check your AAD groups/SP groups once per day. |
@wobba That's great to hear! Appreciate you implementing this important functionality. Can't wait to use it... thx again! |
@stormanh Code is updated in the repo, enjoy :) |
@wobba Thanks for updating the webpart. I have tested and confirmed it's working with audience targeting. However, my original request (sorry if it was unclear) was to restrict actual usage of the webpart (by hiding it from the list of available webparts that are available to be added to the page) based on user account, SharePoint Group, or Entra Security Group. Again, sorry for the confusion. Hopefully the below screenshot clarifies the original ask. |
@stormanh it's all in the SPFx docs :) https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/basics/hide-web-part-from-toolbox Set that flag and add the web part programatically instead. Or better yet, develop a proper SPFx webpart with the code you want to run. This web part should not be used imo. |
Disclaimer
Yes
Sample
react-script-editor
Contributor(s)
@wobba @salascz @felixbohnacker
Question
This is a powerful webpart that we would like to limit to a group of selected users only by leveraging the audience targeting feature that would make this webpart available for selected users, or a given security group. Could you add this in the next update please? Thank you for your consideration!
The text was updated successfully, but these errors were encountered: