File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
- import { populate , discard } from 'feathers-hooks-common' ;
1
+ import { populate , discard , disallow } from 'feathers-hooks-common' ;
2
2
import requireAuth from '../../hooks/requireAuth' ;
3
3
import signAuthority from '../../hooks/signAuthority' ;
4
4
import sortByDate from '../../hooks/sortByDate' ;
@@ -18,7 +18,10 @@ const populateAuthor = populate({
18
18
export default {
19
19
before : {
20
20
create : [ requireAuth , signAuthority ] ,
21
- find : sortByDate
21
+ find : sortByDate ,
22
+ remove : disallow ( 'external' ) ,
23
+ patch : disallow ( 'external' ) ,
24
+ update : disallow ( 'external' )
22
25
} ,
23
26
after : {
24
27
all : [ populateAuthor , discard ( 'authorId' ) ]
Original file line number Diff line number Diff line change 1
1
import { HookContext } from '@feathersjs/feathers' ;
2
+ import { disallow } from 'feathers-hooks-common' ;
2
3
import { Types } from 'mongoose' ;
3
4
import bluebird from 'bluebird' ; import _ from 'lodash' ;
4
5
import { Poll } from 'which-types' ;
@@ -46,7 +47,10 @@ const convertPoll = async (context: HookContext): Promise<HookContext> => {
46
47
export default {
47
48
before : {
48
49
find : sortByDate ,
49
- create : signAuthority
50
+ create : signAuthority ,
51
+ remove : disallow ( 'external' ) ,
52
+ update : disallow ( 'external' ) ,
53
+ patch : disallow ( 'external' )
50
54
} ,
51
55
after : {
52
56
all : convertPoll
Original file line number Diff line number Diff line change
1
+ import { disallow } from 'feathers-hooks-common' ;
1
2
import requireAuth from '../../hooks/requireAuth' ;
2
3
import signAuthority from '../../hooks/signAuthority' ;
3
4
4
5
export default {
5
6
before : {
6
- create : [ requireAuth , signAuthority ]
7
+ create : [ requireAuth , signAuthority ] ,
8
+ remove : disallow ( 'external' ) ,
9
+ update : disallow ( 'external' ) ,
10
+ patch : disallow ( 'external' )
7
11
}
8
12
} ;
9
13
You can’t perform that action at this time.
0 commit comments