This commit is contained in:
Tom Moor
2020-12-25 18:04:38 -08:00
parent a51af98d43
commit ba2552f69f
4 changed files with 31 additions and 19 deletions

View File

@ -8,7 +8,7 @@ const { allow, cannot } = policy;
allow(User, "create", Document);
allow(User, "batchImport", Document, actor => {
allow(User, "batchImport", Document, (actor) => {
if (actor.isAdmin) return true;
throw new AdminRequiredError();
});