File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ func Register(c *fiber.Ctx) (err error) {
6969// @Failure 500 {object} common.MessageResponse
7070// @Security ApiKeyAuth
7171func RegisterDebug (c * fiber.Ctx ) (err error ) {
72+ operatorID , err := common .GetUserID (c )
73+ if err != nil {
74+ return err
75+ }
76+ if ! IsAdmin (operatorID ) {
77+ return common .Forbidden ()
78+ }
79+
7280 var body LoginRequest
7381 err = common .ValidateBody (c , & body )
7482 if err != nil {
@@ -92,6 +100,14 @@ func RegisterDebug(c *fiber.Ctx) (err error) {
92100// @Failure 500 {object} common.MessageResponse
93101// @Security ApiKeyAuth
94102func RegisterDebugInBatch (c * fiber.Ctx ) (err error ) {
103+ operatorID , err := common .GetUserID (c )
104+ if err != nil {
105+ return err
106+ }
107+ if ! IsAdmin (operatorID ) {
108+ return common .Forbidden ()
109+ }
110+
95111 const taskScope = "register_in_batch"
96112 log .Info ().Str ("scope" , taskScope ).Msg ("register in batch" )
97113
You can’t perform that action at this time.
0 commit comments