feat: improve RequireAdmin() logic

This commit is contained in:
Yang Luo
2024-03-16 20:49:17 +08:00
parent 1bd0245e7a
commit be88b00278
2 changed files with 10 additions and 0 deletions

View File

@ -127,6 +127,11 @@ func (c *ApiController) RequireAdmin() (string, bool) {
if user.Owner == "built-in" {
return "", true
}
if !user.IsAdmin {
return "", false
}
return user.Owner, true
}