Add object.IsAppUser()

This commit is contained in:
Yang Luo
2024-04-24 01:10:38 +08:00
parent 90d502ab2b
commit af2d26daf2
7 changed files with 15 additions and 8 deletions

View File

@ -73,7 +73,7 @@ func (c *ApiController) IsAdminOrSelf(user2 *object.User) bool {
func (c *ApiController) isGlobalAdmin() (bool, *object.User) {
username := c.GetSessionUsername()
if strings.HasPrefix(username, "app/") {
if object.IsAppUser(username) {
// e.g., "app/app-casnode"
return true, nil
}