I need to someone pass users for spfx webpart to show or not show a properties. Nativly we can do it by passing or not pass context web in getPropertyPaneConfiguration(). But the webpart will be on all sites. And I need to pass a link for the site where can I set users with example (SPPermission.createGroups. How could I do it ? I havve got this code:

  protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
let contextWeb =  this.context.pageContext.web;
let permission = new SPPermission(contextWeb.permissions.value);
let hasPermission = permission.hasPermission(SPPermission.createGroups);

return {
  pages: [

but iI want with site contextWeb pass a url where the Users will be finding for SPPermission.createGroups. Not all sites, but specify site from the link. Please help me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.