diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-07-07 13:04:21 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-07-07 13:04:21 -0400 |
commit | dd628b8b175d866fc39342a3f91e62bda3b63ba3 (patch) | |
tree | 6f09369411eaeaae21c27e8eb62933b31ab99120 /src | |
parent | 3dde1b790b0f29c0dca4d35ad91c1f389efe831a (diff) |
guest permission fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/SharingManager.tsx | 2 | ||||
-rw-r--r-- | src/client/views/PropertiesView.tsx | 3 | ||||
-rw-r--r-- | src/fields/util.ts | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx index 67b4d9d1a..3a0672113 100644 --- a/src/client/util/SharingManager.tsx +++ b/src/client/util/SharingManager.tsx @@ -582,7 +582,7 @@ export class SharingManager extends React.Component<{}> { </div> </div> ) : null, - sameAuthor && targetDoc?.author !== Doc.CurrentUserEmail ? ( + sameAuthor && targetDoc?.author !== Doc.CurrentUserEmail && Doc.CurrentUserEmail != 'guest' ? ( <div key={'me'} className={'container'}> <span className={'padding'}>Me</span> <div className="edit-actions"> diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 14291b537..2b12a7b58 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -463,8 +463,7 @@ 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) { + if (!usersAdded.includes(userEmail) && userEmail != 'guest' && userEmail != target.author) { var permission; if (this.layoutDocAcls){ if (target[DocAcl][userKey]) permission = HierarchyMapping.get(target[DocAcl][userKey])?.name; diff --git a/src/fields/util.ts b/src/fields/util.ts index cc29c7df9..068323dce 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -209,9 +209,13 @@ export function SetCachedGroups(groups: string[]) { } function getEffectiveAcl(target: any, user?: string): symbol { const targetAcls = target[DocAcl]; - if (targetAcls?.['acl-Me'] === AclAdmin || GetCachedGroupByName('Admin')) return AclAdmin; + // if (targetAcls?.['acl-Me'] === AclAdmin || GetCachedGroupByName('Admin')) return AclAdmin; const userChecked = user || Doc.CurrentUserEmail; // if the current user is the author of the document / the current user is a member of the admin group + + // guest dashboard permissions error + if (userChecked == 'guest' && target._type_collection == CollectionViewType.Docking) return AclAugment; + if (targetAcls && Object.keys(targetAcls).length) { let effectiveAcl = AclPrivate; for (const [key, value] of Object.entries(targetAcls)) { |