diff options
Diffstat (limited to 'src/client/views/PropertiesView.tsx')
| -rw-r--r-- | src/client/views/PropertiesView.tsx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index ca357f830..904755132 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -453,9 +453,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { const userKey = `acl-${normalizeEmail(userEmail)}`; var permission; if (this.layoutDocAcls){ - if (target[DocAcl][userKey]){ - permission = HierarchyMapping.get(target[DocAcl][userKey])?.name; - } + if (target[DocAcl][userKey]) permission = HierarchyMapping.get(target[DocAcl][userKey])?.name; else if (target['embedContainer']) permission = StrCast(Doc.GetProto(DocCast(target['embedContainer']))[userKey]); else permission = StrCast(Doc.GetProto(target)?.[userKey]); } @@ -465,10 +463,17 @@ export class PropertiesView extends React.Component<PropertiesViewProps> { // adds current user var userEmail = Doc.CurrentUserEmail; + const userKey = `acl-${normalizeEmail(userEmail)}`; if (userEmail == 'guest') userEmail = 'Public'; if (!usersAdded.includes(userEmail) && userEmail != 'Public' && userEmail != target.author) { - individualTableEntries.unshift(this.sharingItem(userEmail, showAdmin, StrCast(target[`acl-${normalizeEmail(userEmail)}`]), false)); // adds each user - usersAdded.push(userEmail); + var permission; + if (this.layoutDocAcls){ + if (target[DocAcl][userKey]) permission = HierarchyMapping.get(target[DocAcl][userKey])?.name; + else if (target['embedContainer']) permission = StrCast(Doc.GetProto(DocCast(target['embedContainer']))[userKey]); + else permission = StrCast(Doc.GetProto(target)?.[userKey]); + } + else permission = StrCast(target[userKey]); + individualTableEntries.unshift(this.sharingItem(userEmail, showAdmin, permission!, false)); // adds each user } // shift owner to top |
