fix: Remove export permission for read-only users (#2220)

This commit is contained in:
Tom Moor
2021-06-13 14:41:29 -07:00
committed by GitHub
parent 756ec92cdb
commit 89f8df619c
3 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ allow(User, "move", Collection, (user, collection) => {
throw new AdminRequiredError();
});
allow(User, ["read", "export"], Collection, (user, collection) => {
allow(User, "read", Collection, (user, collection) => {
if (!collection || user.teamId !== collection.teamId) return false;
if (!collection.permission) {
@ -47,7 +47,7 @@ allow(User, ["read", "export"], Collection, (user, collection) => {
return true;
});
allow(User, "share", Collection, (user, collection) => {
allow(User, ["share", "export"], Collection, (user, collection) => {
if (user.isViewer) return false;
if (!collection || user.teamId !== collection.teamId) return false;
if (!collection.sharing) return false;