mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-09 15:52:55 +08:00
Add GetUserNoCheck().
This commit is contained in:
@@ -166,7 +166,7 @@ func (c *ApiController) UploadResource() {
|
|||||||
switch tag {
|
switch tag {
|
||||||
case "avatar":
|
case "avatar":
|
||||||
if user == nil {
|
if user == nil {
|
||||||
user = object.GetUser(username)
|
user = object.GetUserNoCheck(username)
|
||||||
if user == nil {
|
if user == nil {
|
||||||
c.ResponseError("user is nil for tag: \"avatar\"")
|
c.ResponseError("user is nil for tag: \"avatar\"")
|
||||||
return
|
return
|
||||||
|
@@ -200,6 +200,11 @@ func GetUser(id string) *User {
|
|||||||
return getUser(owner, name)
|
return getUser(owner, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetUserNoCheck(id string) *User {
|
||||||
|
owner, name := util.GetOwnerAndNameFromIdNoCheck(id)
|
||||||
|
return getUser(owner, name)
|
||||||
|
}
|
||||||
|
|
||||||
func GetMaskedUser(user *User) *User {
|
func GetMaskedUser(user *User) *User {
|
||||||
if user == nil {
|
if user == nil {
|
||||||
return nil
|
return nil
|
||||||
@@ -233,7 +238,7 @@ func GetLastUser(owner string) *User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func UpdateUser(id string, user *User) bool {
|
func UpdateUser(id string, user *User) bool {
|
||||||
owner, name := util.GetOwnerAndNameFromId(id)
|
owner, name := util.GetOwnerAndNameFromIdNoCheck(id)
|
||||||
oldUser := getUser(owner, name)
|
oldUser := getUser(owner, name)
|
||||||
if oldUser == nil {
|
if oldUser == nil {
|
||||||
return false
|
return false
|
||||||
|
Reference in New Issue
Block a user