mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 19:40:19 +08:00
fix: unmask application for org admin (#2138)
* feat: unmask application with user admin * Update application.go --------- Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
@ -860,3 +860,11 @@ func AddUserkeys(user *User, isAdmin bool) (bool, error) {
|
||||
|
||||
return UpdateUser(user.GetId(), user, []string{}, isAdmin)
|
||||
}
|
||||
|
||||
func (user *User) IsApplicationAdmin(application *Application) bool {
|
||||
if user == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return (user.Owner == application.Organization && user.IsAdmin) || user.IsGlobalAdmin
|
||||
}
|
||||
|
Reference in New Issue
Block a user