How to use the @microsoft/sp-page-context.SPPermission.managePermissions function in @microsoft/sp-page-context

To help you get started, we’ve selected a few @microsoft/sp-page-context examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SharePoint / sp-dev-fx-extensions / samples / js-command-lock-item / src / extensions / lockItem / LockItemCommandSet.ts View on Github external
public onInit(): Promise {
    Log.info(LOG_SOURCE, 'Initialized LockItemCommandSet');
    // this where we check the permissions
    this._hasCorrectPermissions = this.context.pageContext.list.permissions.hasPermission(SPPermission.managePermissions);

    // setting up the pnp to work correctly with SPFx
    pnp.setup({
      spfxContext: this.context
    });
    return Promise.resolve();
  }

@microsoft/sp-page-context

Page context services for the SharePoint Framework

https://aka.ms/spfx/license
Latest version published 3 months ago

Package Health Score

66 / 100
Full package analysis

Similar packages