mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix owner view access to snapshots
Summary: Owners weren't able to access snapshots if access rules that denied access to non-owners existed. The backend was lowering snapshot document access to "viewers" as part of implementing read-only behavior; this is now done in the client, with document access for snapshots now accurately reflecting the user's trunk access. Additionally, sandboxes are no longer created for snapshots, and background intervals aren't started for snapshots. Test Plan: Browser test. Reviewers: jarek, paulfitz Reviewed By: jarek, paulfitz Differential Revision: https://phab.getgrist.com/D3849
This commit is contained in:
@@ -36,7 +36,7 @@ export function buildShareMenuButton(pageModel: DocPageModel): DomContents {
|
||||
return dom.maybe(pageModel.currentDoc, (doc) => {
|
||||
const appModel = pageModel.appModel;
|
||||
const saveCopy = () => makeCopy(doc, appModel, t("Save Document")).catch(reportError);
|
||||
if (doc.idParts.snapshotId) {
|
||||
if (doc.isSnapshot) {
|
||||
const backToCurrent = () => urlState().pushUrl({doc: buildOriginalUrlId(doc.id, true)});
|
||||
return shareButton(t("Back to Current"), () => [
|
||||
menuManageUsers(doc, pageModel),
|
||||
|
||||
@@ -86,7 +86,7 @@ export function createTopBarDoc(owner: MultiHolder, appModel: AppModel, pageMode
|
||||
isRecoveryMode: pageModel.isRecoveryMode,
|
||||
isTutorialFork: pageModel.isTutorialFork,
|
||||
isFiddle: Computed.create(owner, (use) => use(pageModel.isPrefork)),
|
||||
isSnapshot: Computed.create(owner, doc, (use, _doc) => Boolean(_doc && _doc.idParts.snapshotId)),
|
||||
isSnapshot: pageModel.isSnapshot,
|
||||
isPublic: Computed.create(owner, doc, (use, _doc) => Boolean(_doc && _doc.public)),
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user