mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-10-14 09:16:28 +00:00
fix🔒: add AuthCheckRole to /role-status and /roledatascope
The group only had JWT, so any logged-in user could change another role's status or data scope regardless of their own permissions.
This commit is contained in:
@@ -23,7 +23,7 @@ func registerSysRoleRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
|
||||
r.PUT("/:id", api.Update)
|
||||
r.DELETE("", api.Delete)
|
||||
}
|
||||
r1 := v1.Group("").Use(authMiddleware.MiddlewareFunc())
|
||||
r1 := v1.Group("").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||
{
|
||||
r1.PUT("/role-status", api.Update2Status)
|
||||
r1.PUT("/roledatascope", api.Update2DataScope)
|
||||
|
||||
Reference in New Issue
Block a user