From a8a9a9121e728227703513fa0750e64fc53cde86 Mon Sep 17 00:00:00 2001 From: Gunjan Datta Date: Wed, 29 Jul 2026 20:13:09 -0400 Subject: [PATCH] Added new property. --- .../webparts/siteAdmin/SiteAdminWebPart.manifest.json | 1 + spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts | 10 ++++++++++ spfx/src/webparts/siteAdmin/loc/en-us.js | 1 + spfx/src/webparts/siteAdmin/loc/mystrings.d.ts | 1 + src/reports/viewPermissions.ts | 8 +++++--- src/tabs/reports.ts | 4 +++- 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json index 6e92901..6c5469f 100644 --- a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json +++ b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json @@ -42,6 +42,7 @@ "ReportsDocSearchFileExt": "csv doc docx dot dotx pdf pot potx pps ppsx ppt pptx txt xls xlsx xlt xltx", "ReportsDocSearchKeywords": "phi pii ssn", "ReportsDocSearchRegexPatterns": ".*(\\d{3}-\\d{2}-\\d{4}).* .*([0-9]{3}[\\s.-]?[0-9]{2}[\\s.-]?[0-9]{4}).*", + "ReportsSecureFileText": "This action will create unique permissions for the file and remove explicit permissions to groups that are flagging this file as overshared.\n\nIf access to the file is currently granted through a SharePoint group, then that group will be removed from the file's permissions. For example, if the \"Visitors Group\" contains the \"All Guests\" group; then the \"Visitors Group\" will be removed from the file's permissions.\n\nIt is recommended to review the file's permissions after securing it to ensure it is properly permissioned to the people who require access.", "SensitivityLabelFileExt": "csv doc docx dot dotx pdf pot potx pps ppsx ppt pptx txt xls xlsx xlt xltx", "SiteAttestation": false, "SiteAttestationText": "This will confirm that you have completed your tasks defined by your governance for site administration.", diff --git a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts index c2a0199..0c3a039 100644 --- a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts +++ b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts @@ -70,6 +70,7 @@ export interface ISiteAdminWebPartProps { ReportsDocSearchFileExt: string; ReportsDocSearchKeywords: string; ReportsDocSearchRegexPatterns: string; + ReportsSecureFileText: string; ReportsOversharedGroups: string; SensitivityLabelFileExt: string; SiteAttestation: boolean; @@ -206,6 +207,7 @@ declare const SiteAdmin: { docSearchKeywords?: string; docSearchRegexPatterns?: string; oversharedGroups?: string[]; + secureFileText?: string; sensitivityLabelFileExt?: string; } searchProps?: { @@ -625,6 +627,13 @@ export default class SiteAdminWebPart extends BaseClientSideWebPart group.trim()), + secureFileText: this.properties.ReportsSecureFileText, sensitivityLabelFileExt: this.properties.SensitivityLabelFileExt }, searchProps: { diff --git a/spfx/src/webparts/siteAdmin/loc/en-us.js b/spfx/src/webparts/siteAdmin/loc/en-us.js index 5935722..cff0d53 100644 --- a/spfx/src/webparts/siteAdmin/loc/en-us.js +++ b/spfx/src/webparts/siteAdmin/loc/en-us.js @@ -11,6 +11,7 @@ define([], function () { "ReportsDocSearchKeywords": "Document Search Default Keywords", "ReportsDocSearchRegexPatterns": "Document Search Default Regex Patterns", "ReportsOversharedGroups": "Overshared Groups", + "ReportsSecureFileText": "Secure File Text", "SensitivityLabelFileExt": "Sensitivity Label File Extensions", "SitePropAttestationDate": "Site Attestation Date", "SitePropAttestationUser": "Site Attestation User", diff --git a/spfx/src/webparts/siteAdmin/loc/mystrings.d.ts b/spfx/src/webparts/siteAdmin/loc/mystrings.d.ts index f5b9fcc..fecd301 100644 --- a/spfx/src/webparts/siteAdmin/loc/mystrings.d.ts +++ b/spfx/src/webparts/siteAdmin/loc/mystrings.d.ts @@ -10,6 +10,7 @@ declare interface ISiteAdminWebPartStrings { ReportsDocSearchKeywords: string; ReportsDocSearchRegexPatterns: string; ReportsOversharedGroups: string; + ReportsSecureFileText: string; SensitivityLabelFileExt: string; SitePropAttestationDate: string; SitePropAttestationUser: string; diff --git a/src/reports/viewPermissions.ts b/src/reports/viewPermissions.ts index 38a1bc8..f852f23 100644 --- a/src/reports/viewPermissions.ts +++ b/src/reports/viewPermissions.ts @@ -21,6 +21,10 @@ export class ViewPermissions { static get OversharedGroups(): string[] { return this._oversharedGroups; } static set OversharedGroups(value: string[]) { this._oversharedGroups = value; } + private static _secureFileText: string = ""; + static get SecureFileText(): string { return this._secureFileText; } + static set SecureFileText(value: string) { this._secureFileText = value; } + // Returns the groups that are flagging the file as overshared static getOversharedGroups(roles: Types.SP.RoleAssignmentOData[]): string[] { let groups = []; @@ -122,9 +126,7 @@ export class ViewPermissions { // Set the content CanvasForm.setBody(` -

This action will create unique permissions for the file and remove explicit permissions to groups that are flagging this file as overshared.

-

If access to the file is currently granted through a SharePoint group, then that group will be removed from the file's permissions. For example, if the "Visitors Group" contains the "All DoD Guests" group; then the "Visitors Group" will be removed from the file's permissions.

-

It is recommended to review the file's permissions after securing it to ensure it is properly permissioned to the people who require access.

+

${this.SecureFileText.replace(/\n/g, "
")}

The following groups will be removed from the file's permissions:

diff --git a/src/tabs/reports.ts b/src/tabs/reports.ts index 4e454bb..df076d9 100644 --- a/src/tabs/reports.ts +++ b/src/tabs/reports.ts @@ -13,6 +13,7 @@ export interface IReportProps { docSearchKeywords?: string; docSearchRegexPatterns?: string; oversharedGroups?: string[]; + secureFileText?: string; sensitivityLabelFileExt?: string; } @@ -56,8 +57,9 @@ export class ReportsTab { this._reportProps = appProps.reportProps; this._searchProps = appProps.searchProps; - // Set the overshared groups + // Set the view permissions properties ViewPermissions.OversharedGroups = appProps.reportProps.oversharedGroups || []; + ViewPermissions.SecureFileText = appProps.reportProps.secureFileText || ""; // Determine if this is in audit mode this._auditOnly = !DataSource.IsAdmin || (appProps.auditOnly ? true : false);