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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"adm-zip": "^0.5.18",
"datatables.net": "^3.0.0",
"datatables.net-bs5": "^3.0.0",
"dattatable": "^2.11.81",
"dattatable": "^2.11.83",
"exceljs": "^4.4.0",
"fast-xml-parser": "^5.9.3",
"gd-sprest-bs": "^10.15.91",
Expand Down
55 changes: 54 additions & 1 deletion src/reports/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface IPermissionItem {
GroupUsersCount?: number;
GroupUrl?: string;
Id?: number;
IsLimitedAccess: boolean;
LoginName: string;
Name: string;
Roles?: string[];
Expand Down Expand Up @@ -210,6 +211,7 @@ export class Permissions {
Everyone: false,
GroupIds: [],
Id: role.Member.Id,
IsLimitedAccess: false,
LoginName: role.Member.LoginName,
Name: role.Member.Title,
Roles: [],
Expand All @@ -229,6 +231,7 @@ export class Permissions {
Everyone: false,
GroupIds: [],
Id: role.Member.Id,
IsLimitedAccess: false,
LoginName: role.Member.LoginName,
Name: role.Member.Title,
Roles: [],
Expand All @@ -249,6 +252,7 @@ export class Permissions {
Everyone: role.Member.Title == "Everyone",
GroupIds: groupId ? [groupId] : [],
Id: role.Member.Id,
IsLimitedAccess: false,
LoginName: role.Member.LoginName,
Name: role.Member.Title,
Roles: [],
Expand All @@ -266,6 +270,12 @@ export class Permissions {
// Add the permission
item.Roles.push(roleDef.Name);
item.RoleInfo.push(roleDef.Description);

// See if this only has limited access
if (roleDef.Name == "Limited Access" && item.Roles.length === 1) {
// Set the flag
item.IsLimitedAccess = true;
}
});

// Analyze the users for this item
Expand Down Expand Up @@ -435,6 +445,35 @@ export class Permissions {
}
}];

// Show the filter button for permissions
navItems.push({
text: "Show Limited Access",
className: "btn-outline-light ms-2",
isButton: true,
onClick: () => {
// Get the error button
let elNav = this._elDashboard.querySelector("#navigation .navbar-nav");

// Remove the last button
let btn = elNav.querySelector("li:nth-child(2) a");

// See if we are currently hiding limited access items
if (btn.textContent == "Show Limited Access") {
// Remove the filter
this._dashboard.filter(3);

// Update the button text
btn.innerHTML = "Hide Limited Access";
} else {
// Apply the filter
this._dashboard.filter(3, "false");

// Update the button text
btn.innerHTML = "Show Limited Access";
}
}
});

// Show the error button
navItems.push({
text: "Errors",
Expand Down Expand Up @@ -466,12 +505,19 @@ export class Permissions {
table: {
rows: items,
onRendering: dtProps => {
// Remove the order/sort option for the action column
dtProps.columnDefs.push({
"targets": 8,
"targets": 9,
"orderable": false,
"searchable": false
});

// Hide the limited access column
dtProps.columnDefs.push({
"targets": 3,
"visible": false
});

// Order by the 1st column
dtProps.order = [[0, "asc"]];

Expand Down Expand Up @@ -499,6 +545,10 @@ export class Permissions {
name: "EEEU",
title: "Has<br/>EEEU?"
},
{
name: "IsLimitedAccess",
title: "Is<br/>Limited Access?"
},
{
name: "",
title: "M365<br/>Groups",
Expand Down Expand Up @@ -655,6 +705,9 @@ export class Permissions {
this._elSubNav.classList.remove("d-none");
this._elSubNav.classList.add("my-2");
this._elSubNav.innerHTML = `<div class="h6"></div><div></div>`;

// Hide the limited access items by default
this._dashboard.filter(3, "false");
}

// Runs the report
Expand Down
Loading