aboutsummaryrefslogtreecommitdiff
path: root/services/polls
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-07-05 13:38:33 +0300
committerGitHub <noreply@github.com>2020-07-05 13:38:33 +0300
commit96398e544463651413ea80821c09ae7573f46cb1 (patch)
treedf77b6f65247d87dbfde8000e918c83985624fc3 /services/polls
parentda76bb1bd8797c4e1dc657c489f597bf64918ceb (diff)
parent1c2f3c9e5b39826266d64f4227e53fff139ea948 (diff)
downloadwhich-api-96398e544463651413ea80821c09ae7573f46cb1.tar.gz
Merge pull request #17 from which-ecosystem/security
Prepare release-level backend security
Diffstat (limited to 'services/polls')
-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