(core) Limiting doc remove permission to owners.

Summary:
Guest editors added to a document were able to remove it. This limits this permission
by allowing only owners of a doc to delete it.

Test Plan: Updated

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: dsagal, anaisconce

Differential Revision: https://phab.getgrist.com/D3708
This commit is contained in:
Jarosław Sadziński
2022-11-30 23:10:07 +01:00
parent 601ba58a2e
commit 59942a23b6
4 changed files with 38 additions and 9 deletions

View File

@@ -26,6 +26,19 @@ export function configForUser(username: string): AxiosRequestConfig {
return config;
}
/**
* Appends a permit key to the given config. Creates a new config object.
*/
export function configWithPermit(config: AxiosRequestConfig, permitKey: string): AxiosRequestConfig {
return {
...config,
headers: {
...config.headers,
Permit: permitKey
}
};
}
/**
* Create a new user and return their personal org.
*/