Skip to content
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

Closed
stormanh opened this issue Sep 10, 2024 · 7 comments
Assignees
Labels
status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:question

Comments

@stormanh
Copy link

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!

@wobba
Copy link
Contributor

wobba commented Sep 10, 2024

@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:

  • SharePoint Security groups?
  • AAD groups?
  • Users?

@stormanh
Copy link
Author

@wobba That is correct. Allow specified:
SharePoint Security groups
AAD groups
Users

Thank you!

@wobba
Copy link
Contributor

wobba commented Sep 12, 2024

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 wobba added the status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. label Sep 12, 2024
@wobba wobba self-assigned this Sep 12, 2024
@stormanh
Copy link
Author

@wobba That's great to hear! Appreciate you implementing this important functionality. Can't wait to use it... thx again!

wobba added a commit that referenced this issue Sep 25, 2024
@wobba
Copy link
Contributor

wobba commented Sep 25, 2024

@stormanh Code is updated in the repo, enjoy :)

@wobba wobba closed this as completed Sep 25, 2024
@stormanh
Copy link
Author

@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.
image

@wobba
Copy link
Contributor

wobba commented Oct 1, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:question
Projects
None yet
Development

No branches or pull requests

2 participants