aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesView.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-06-26 15:02:12 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-06-26 15:02:12 -0400
commit68e791512551261fd805f841fd88aba373df845a (patch)
tree3c0c620a582375aec233ae2cb20a4e3d8c9b521b /src/client/views/PropertiesView.tsx
parentfbfd21718e63e13ec5b8ba913a65b3ee76891a34 (diff)
layout always an option in SharingManager, current user layout acl bug fix in PropertiesView + SharingManager
Diffstat (limited to 'src/client/views/PropertiesView.tsx')
-rw-r--r--src/client/views/PropertiesView.tsx15
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