From a77f3f1fe3841e81c83a46c534a81b92411a2788 Mon Sep 17 00:00:00 2001 From: Ole Martin Pettersen Date: Thu, 26 Nov 2020 16:09:57 +0100 Subject: [PATCH] =?UTF-8?q?Portef=C3=B8ljeinnsyn:=20=20=20OnlyAllowMembers?= =?UTF-8?q?ViewMembership=3D"true"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PortfolioOverview/index.tsx | 24 +++++++------------ .../PortfolioWebParts/src/data/index.ts | 4 ++-- .../webparts/benefitsOverview/manifest.json | 2 +- .../webparts/deliveriesOverview/manifest.json | 2 +- .../src/webparts/experienceLog/manifest.json | 2 +- .../src/webparts/latestProjects/manifest.json | 2 +- .../webparts/portfolioInsights/manifest.json | 2 +- .../webparts/portfolioOverview/manifest.json | 2 +- .../src/webparts/projectList/manifest.json | 2 +- .../webparts/resourceAllocation/manifest.json | 2 +- .../src/webparts/riskOverview/manifest.json | 2 +- Templates/Portfolio/Objects/Security.xml | 4 +++- 12 files changed, 22 insertions(+), 28 deletions(-) diff --git a/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/index.tsx b/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/index.tsx index 0458f3990..91a41c6cc 100644 --- a/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/index.tsx +++ b/SharePointFramework/PortfolioWebParts/src/components/PortfolioOverview/index.tsx @@ -337,42 +337,36 @@ export class PortfolioOverview extends React.Component< target: ev.currentTarget, items: [ { - id: getId('SortDesc'), - key: getId('SortDesc'), + key: 'SORT_DESC', name: strings.SortDescLabel, canCheck: true, checked: column.isSorted && column.isSortedDescending, onClick: () => this._onColumnSort(column, true) }, { - id: getId('SortAsc'), - key: getId('SortAsc'), + key: 'SORT_ASC', name: strings.SortAscLabel, canCheck: true, checked: column.isSorted && !column.isSortedDescending, onClick: () => this._onColumnSort(column, false) }, { - id: getId('Divider'), - key: getId('Divider'), + key: 'DIVIDER_01', itemType: ContextualMenuItemType.Divider }, { - id: getId('FilterBy'), - key: getId('FilterBy'), + key: 'FILTER_BY', name: strings.FilterBy, canCheck: true, checked: false, disabled: true }, { - id: getId('Divider'), - key: getId('Divider'), + key: 'DIVIDER_02', itemType: ContextualMenuItemType.Divider }, { - id: getId('GroupBy'), - key: getId('GroupBy'), + key: 'GROUP_BY', name: format(strings.GroupByColumnLabel, column.name), canCheck: true, checked: @@ -381,13 +375,11 @@ export class PortfolioOverview extends React.Component< onClick: () => this._onColumnGroupBy(column) }, { - id: getId('Divider'), - key: getId('Divider'), + key: 'DIVIDER_03', itemType: ContextualMenuItemType.Divider }, { - id: getId('ColumSettings'), - key: getId('ColumSettings'), + key: 'COLUMN_SETTINGS', name: strings.ColumSettingsLabel, onClick: () => redirect(`${this.props.configuration.columnUrls.defaultEditFormUrl}?ID=${column.id}`), diff --git a/SharePointFramework/PortfolioWebParts/src/data/index.ts b/SharePointFramework/PortfolioWebParts/src/data/index.ts index c2a3e363c..3ed04d02c 100644 --- a/SharePointFramework/PortfolioWebParts/src/data/index.ts +++ b/SharePointFramework/PortfolioWebParts/src/data/index.ts @@ -378,11 +378,11 @@ export class DataAdapter { */ private async _isUserInGroup(groupName: string): Promise { try { - const siteGroups = await sp.web.siteGroups + const [siteGroup] = await sp.web.siteGroups .select('CanCurrentUserViewMembership', 'Title') .filter(`Title eq '${groupName}'`) .get() - return siteGroups.length === 1 && siteGroups[0].CanCurrentUserViewMembership + return siteGroup && siteGroup.CanCurrentUserViewMembership } catch (error) { return false } diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/benefitsOverview/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/benefitsOverview/manifest.json index b2da8c6df..7c5d9dd3d 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/benefitsOverview/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/benefitsOverview/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/deliveriesOverview/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/deliveriesOverview/manifest.json index bc908d540..6a348dddd 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/deliveriesOverview/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/deliveriesOverview/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/experienceLog/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/experienceLog/manifest.json index 88a5a1dc7..19336fa8e 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/experienceLog/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/experienceLog/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/latestProjects/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/latestProjects/manifest.json index b98b708c1..923ea32b7 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/latestProjects/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/latestProjects/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/portfolioInsights/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/portfolioInsights/manifest.json index 89bc78d83..52673aac9 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/portfolioInsights/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/portfolioInsights/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/portfolioOverview/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/portfolioOverview/manifest.json index 164a8042a..2979d0e37 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/portfolioOverview/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/portfolioOverview/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/projectList/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/projectList/manifest.json index 8bf4c77a9..03295d937 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/projectList/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/projectList/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/resourceAllocation/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/resourceAllocation/manifest.json index 74a879c91..322df0d83 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/resourceAllocation/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/resourceAllocation/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/SharePointFramework/PortfolioWebParts/src/webparts/riskOverview/manifest.json b/SharePointFramework/PortfolioWebParts/src/webparts/riskOverview/manifest.json index 83653195c..5c33405ba 100644 --- a/SharePointFramework/PortfolioWebParts/src/webparts/riskOverview/manifest.json +++ b/SharePointFramework/PortfolioWebParts/src/webparts/riskOverview/manifest.json @@ -6,7 +6,7 @@ "version": "1.2.4", "manifestVersion": 2, "requiresCustomScript": false, - "hiddenFromToolbox": true, + "hiddenFromToolbox": false, "supportedHosts": [ "SharePointWebPart" ], diff --git a/Templates/Portfolio/Objects/Security.xml b/Templates/Portfolio/Objects/Security.xml index 80e571137..bdb4b8154 100644 --- a/Templates/Portfolio/Objects/Security.xml +++ b/Templates/Portfolio/Objects/Security.xml @@ -3,7 +3,9 @@ + Owner="{associatedownergroupid}" + AllowMembersEditMembership="false" + OnlyAllowMembersViewMembership="true"> \ No newline at end of file