Skip to content

Commit

Permalink
adjust role authorizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielzxccc committed Dec 26, 2023
1 parent 83b8f64 commit 9b37d49
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions src/modules/Forums/ForumsRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,27 @@ ForumsRouter.get('/:id', ForumsController.viewQuestion)

ForumsRouter.post(
'/vote/:id',
UserGuard(['member']),
UserGuard([
'member',
'farmer',
'farm_head',
'subfarm_head',
'admin',
'asst_admin',
]),
ForumsController.voteQuestion
)

ForumsRouter.post(
'/',
UserGuard([
'member',
'farmer',
'farm_head',
'subfarm_head',
'admin',
'asst_admin',
]),
upload.array('imagesrc'),
ForumsController.createNewQuestion
)
Expand Down Expand Up @@ -273,7 +288,14 @@ ForumsRouter.post(

ForumsRouter.post(
'/create/answers/:id',
UserGuard(['member']),
UserGuard([
'member',
'farmer',
'farm_head',
'subfarm_head',
'admin',
'asst_admin',
]),
ForumsController.createNewAnswer
)

Expand Down Expand Up @@ -325,7 +347,14 @@ ForumsRouter.post(
*/
ForumsRouter.post(
'/create/comments/:answerId',
UserGuard(['member']),
UserGuard([
'member',
'farmer',
'farm_head',
'subfarm_head',
'admin',
'asst_admin',
]),
ForumsController.createNewComment
)

Expand Down

0 comments on commit 9b37d49

Please sign in to comment.