summaryrefslogtreecommitdiff
path: root/src/services/meal/hooks/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/meal/hooks/index.js')
-rw-r--r--src/services/meal/hooks/index.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/services/meal/hooks/index.js b/src/services/meal/hooks/index.js
new file mode 100644
index 0000000..2e2795a
--- /dev/null
+++ b/src/services/meal/hooks/index.js
@@ -0,0 +1,31 @@
+'use strict';
+
+const globalHooks = require('../../../hooks');
+const hooks = require('feathers-hooks');
+const auth = require('feathers-authentication').hooks;
+
+exports.before = {
+ all: [
+ auth.verifyToken(),
+ auth.populateUser(),
+ auth.restrictToAuthenticated(),
+ globalHooks.restrictToOwnersOrAdmins(),
+ ],
+ find: [],
+ get: [],
+ create: [],
+ update: [],
+ patch: [],
+ remove: []
+};
+
+exports.after = {
+ all: [],
+ find: [],
+ get: [],
+ create: [],
+ update: [],
+ patch: [],
+ remove: []
+};
+