Update team and collection authorization

This commit is contained in:
Tom Moor
2018-02-18 01:14:51 -08:00
parent 2f81eb5e87
commit e84fb5e6ba
17 changed files with 181 additions and 135 deletions

View File

@ -5,9 +5,11 @@ import User from '../models/User';
const { allow } = policy;
allow(User, 'create', Document);
allow(
User,
['create', 'read', 'update', 'delete'],
['read', 'update', 'delete'],
Document,
(user, doc) => user.teamId === doc.teamId
(user, document) => user.teamId === document.teamId
);