Ability to revoke, ShareMenu

This commit is contained in:
Tom Moor
2018-05-23 22:09:14 -07:00
parent d93815ca0a
commit 47fb968009
11 changed files with 129 additions and 62 deletions

View File

@@ -65,8 +65,9 @@ router.post('shares.delete', auth(), async ctx => {
const { id } = ctx.body;
ctx.assertPresent(id, 'id is required');
const user = ctx.state.user;
const share = await Share.findById(id);
authorize(ctx.state.user, 'delete', share);
authorize(user, 'delete', share);
await share.destroy();