mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-10-28 02:56:17 +08:00
Fix: Root user should always have admin permission
This commit is contained in:
2
assets
2
assets
Submodule assets updated: 220a080a1b...186f0aac09
@ -315,7 +315,7 @@ func COSCallbackAuth() gin.HandlerFunc {
|
|||||||
func IsAdmin() gin.HandlerFunc {
|
func IsAdmin() gin.HandlerFunc {
|
||||||
return func(c *gin.Context) {
|
return func(c *gin.Context) {
|
||||||
user, _ := c.Get("user")
|
user, _ := c.Get("user")
|
||||||
if user.(*model.User).Group.ID != 1 {
|
if user.(*model.User).Group.ID != 1 && user.(*model.User).ID != 1 {
|
||||||
c.JSON(200, serializer.Err(serializer.CodeAdminRequired, "您不是管理组成员", nil))
|
c.JSON(200, serializer.Err(serializer.CodeAdminRequired, "您不是管理组成员", nil))
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user