Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/function-app.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ if ($item -ne $null) {
Write-Host "Removing the key $searchProp from the property bag...";

# Remove the site property
Remove-PnPPropertyBagValue -Key $searchProp;
Remove-PnPPropertyBagValue -Key $searchProp -Force;

# Set the output
$output = "The property bag $searchProp value was removed.";
Expand Down
24 changes: 14 additions & 10 deletions src/ds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,24 @@ export class DataSource {
if (isSiteAdmin) { return; }

// See if the user is a member
for (let i = 0; i < group.members.results.length; i++) {
if (group.members.results[i].mail == ContextInfo.userEmail) {
// Set the flag
isSiteAdmin = true;
return;
if (group.members) {
for (let i = 0; i < group.members.results.length; i++) {
if (group.members.results[i].mail == ContextInfo.userEmail) {
// Set the flag
isSiteAdmin = true;
return;
}
}
}

// See if the user is a owner
for (let i = 0; i < group.owners.results.length; i++) {
if (group.owners.results[i].mail == ContextInfo.userEmail) {
// Set the flag
isSiteAdmin = true;
return;
if (group.owners) {
for (let i = 0; i < group.owners.results.length; i++) {
if (group.owners.results[i].mail == ContextInfo.userEmail) {
// Set the flag
isSiteAdmin = true;
return;
}
}
}
});
Expand Down