mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) provide a way for an administrator to force reload of a document
Summary: Adds POST /api/housekeeping/docs/:docId/force-reload, which allows the support user to force a document to reload (even if they don't otherwise have access to the document). This could be done without a separate endpoint, but that turned out a bit messy, and there's some advantage to quarantining the exceptional authorization somewhere it could be easily elaborated. Test Plan: adds test Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2713
This commit is contained in:
parent
710014ce54
commit
587da4db97
@ -151,6 +151,16 @@ export class Housekeeper {
|
||||
headers,
|
||||
});
|
||||
}));
|
||||
|
||||
// Force a document to reload. Can be useful during administrative
|
||||
// actions.
|
||||
app.post('/api/housekeeping/docs/:docId/force-reload', this._withSupport(async (docId, headers) => {
|
||||
const url = await this._server.getHomeUrlByDocId(docId, `/api/docs/${docId}/force-reload`);
|
||||
return fetch(url, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user