// Add this import statement
import {sp} from '@pnp/sp';
import pnp, { PermissionKind } from "sp-pnp-js";
public render(): void {
this._trimSuiteBar();
this.domElement.innerHTML = `
<div class="main-wrapper"> </div>`;
//Show the loading indicator inside an element
this.context.statusRenderer.clearLoadingIndicator(this.domElement);
}
private _trimSuiteBar(): void {
debugger
pnp.sp.web.usingCaching()
.currentUserHasPermissions(PermissionKind.EditListItems)
.then(perms => {
var suiteBar = document.getElementById("suiteBarTop");
if (!suiteBar || !perms) return; //return if no suite bar OR perms not high enough
suiteBar.setAttribute("style", "display: block !important");
});
}
No comments:
Post a Comment