fix: validate parameter and nil in func updateUser (#1714)

* fix: validate parameter and nil in func updateUser

* fix: delete blank line
This commit is contained in:
Yaodong Yu
2023-04-09 10:35:30 +08:00
committed by GitHub
parent 3d5a645a3b
commit b7d78d1e27
4 changed files with 36 additions and 13 deletions

View File

@ -20,8 +20,7 @@ import (
"github.com/casdoor/casdoor/object"
)
func checkPermissionForUpdateUser(userId string, newUser object.User, c *ApiController) (bool, string) {
oldUser := object.GetUser(userId)
func checkPermissionForUpdateUser(oldUser, newUser *object.User, c *ApiController) (bool, string) {
organization := object.GetOrganizationByUser(oldUser)
var itemsChanged []*object.AccountItem