This repository was archived by the owner on Jun 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed
server/services/system-notifications Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change 1
1
const { unless, isProvider } = require ( 'feathers-hooks-common' ) ;
2
2
const { isVerified } = require ( 'feathers-authentication-management' ) . hooks ;
3
3
const { authenticate } = require ( 'feathers-authentication' ) . hooks ;
4
- const isModerator = require ( '../../hooks/is-moderator-boolean ' ) ;
4
+ const isAdmin = require ( '../../hooks/is-admin ' ) ;
5
5
6
6
module . exports = {
7
7
before : {
8
8
all : [ ] ,
9
- find : [
10
- unless ( isModerator ( ) )
11
- ] ,
12
- get : [
13
- unless ( isModerator ( ) )
14
- ] ,
9
+ find : [ ] ,
10
+ get : [ ] ,
15
11
create : [
16
12
authenticate ( 'jwt' ) ,
17
- // Allow seeder to seed contributions
18
13
unless ( isProvider ( 'server' ) ,
19
- isVerified ( )
20
- ) ,
14
+ isVerified ( ) ,
15
+ isAdmin ( )
16
+ )
21
17
] ,
22
18
update : [
23
19
authenticate ( 'jwt' ) ,
24
20
unless ( isProvider ( 'server' ) ,
25
- isVerified ( )
26
- ) ,
27
- unless ( isModerator ( ) )
21
+ isVerified ( ) ,
22
+ isAdmin ( )
23
+ )
28
24
] ,
29
25
patch : [
30
26
authenticate ( 'jwt' ) ,
31
27
unless ( isProvider ( 'server' ) ,
32
- isVerified ( )
33
- ) ,
34
- unless ( isModerator ( ) )
28
+ isVerified ( ) ,
29
+ isAdmin ( )
30
+ )
35
31
] ,
36
32
remove : [
37
33
authenticate ( 'jwt' ) ,
38
34
isVerified ( ) ,
39
- unless ( isModerator ( ) )
35
+ isAdmin ( )
40
36
]
41
37
} ,
42
38
You can’t perform that action at this time.
0 commit comments