aboutsummaryrefslogtreecommitdiff
path: root/services/polls/polls.hooks.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-07-05 13:33:00 +0300
committereug-vs <eug-vs@keemail.me>2020-07-05 13:34:41 +0300
commit85b3cc20e8f453868d06d55a688ee8dfe90b80d4 (patch)
treed0af5a84e190a0b80d48c8456771b8cb7e0f5ca4 /services/polls/polls.hooks.ts
parent8f48be5b879b1ae92937dfa1d1f37f08fb167dfa (diff)
downloadwhich-api-85b3cc20e8f453868d06d55a688ee8dfe90b80d4.tar.gz
feat: protect all services
Diffstat (limited to 'services/polls/polls.hooks.ts')
-rw-r--r--services/polls/polls.hooks.ts6
1 files changed, 5 insertions, 1 deletions
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<HookContext> => {
export default {
before: {
find: sortByDate,
- create: signAuthority
+ create: signAuthority,
+ remove: disallow('external'),
+ update: disallow('external'),
+ patch: disallow('external')
},
after: {
all: convertPoll