From 85b3cc20e8f453868d06d55a688ee8dfe90b80d4 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 5 Jul 2020 13:33:00 +0300 Subject: feat: protect all services --- services/polls/polls.hooks.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'services/polls/polls.hooks.ts') diff --git a/services/polls/polls.hooks.ts b/services/polls/polls.hooks.ts index e3d04e7..35eae29 100644 --- a/services/polls/polls.hooks.ts +++ b/services/polls/polls.hooks.ts @@ -1,4 +1,5 @@ import { HookContext } from '@feathersjs/feathers'; +import { disallow } from 'feathers-hooks-common'; import { Types } from 'mongoose'; import bluebird from 'bluebird'; import _ from 'lodash'; import { Poll } from 'which-types'; @@ -46,7 +47,10 @@ const convertPoll = async (context: HookContext): Promise => { export default { before: { find: sortByDate, - create: signAuthority + create: signAuthority, + remove: disallow('external'), + update: disallow('external'), + patch: disallow('external') }, after: { all: convertPoll -- cgit v1.2.3