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:
@ -315,7 +315,7 @@ func COSCallbackAuth() gin.HandlerFunc {
|
||||
func IsAdmin() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
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.Abort()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user