diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/PropertiesView.tsx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 8648d84c2..f5a39898e 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -462,13 +462,13 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { // adds each user to usersAdded SharingManager.Instance.users.forEach(eachUser => { - var userOnDashboard = true; - if (Doc.ActiveDashboard) { - if (Doc.ActiveDashboard['acl-' + normalizeEmail(eachUser.user.email)] == '' || Doc.ActiveDashboard['acl-' + normalizeEmail(eachUser.user.email)] == undefined) { - userOnDashboard = false; + var userOnDoc = true; + if (this.selectedDoc) { + if (this.selectedDoc['acl-' + normalizeEmail(eachUser.user.email)] == '' || this.selectedDoc['acl-' + normalizeEmail(eachUser.user.email)] == undefined) { + userOnDoc = false; } } - if (userOnDashboard && !usersAdded.includes(eachUser.user.email) && eachUser.user.email != 'Public' && eachUser.user.email != target.author) { + if (userOnDoc && !usersAdded.includes(eachUser.user.email) && eachUser.user.email != 'Public' && eachUser.user.email != target.author) { // tableEntries.unshift(this.sharingItem(eachUser.user.email, showAdmin, permission, false)); // adds each user usersAdded.push(eachUser.user.email); } @@ -491,13 +491,10 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { // adds groups const groupList = GroupManager.Instance?.allGroups || []; - const groups = groupList.slice().sort(this.sortGroups); - const commonKeys = intersection(...docs.map(doc => (this.layoutDocAcls ? doc : doc[DocData])).map(doc => doc?.[DocAcl] && Object.keys(doc[DocAcl]))); - const groupListMap: (Doc | { title: string })[] = groups.filter(({ title }) => (docs.length > 1 ? commonKeys.includes(`acl-${normalizeEmail(StrCast(title))}`) : true)); - groupListMap.map(group => { - if (group.title != 'Public' && Doc.ActiveDashboard) { + groupList.map(group => { + if (group.title != 'Public' && this.selectedDoc) { const groupKey = 'acl-' + normalizeEmail(StrCast(group.title)); - if (Doc.ActiveDashboard[groupKey] != '' && Doc.ActiveDashboard[groupKey] != undefined) { + if (this.selectedDoc[groupKey] != '' && this.selectedDoc[groupKey] != undefined) { const permission = StrCast(target[groupKey]); tableEntries.unshift(this.sharingItem(StrCast(group.title), showAdmin, permission, false)); } |