mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
feat: get-user API respects org's account item's view rules now (#3882)
This commit is contained in:
@ -197,8 +197,8 @@ func (c *ApiController) GetUser() {
|
||||
return
|
||||
}
|
||||
|
||||
var organization *object.Organization
|
||||
if user != nil {
|
||||
var organization *object.Organization
|
||||
organization, err = object.GetOrganizationByUser(user)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
@ -237,6 +237,14 @@ func (c *ApiController) GetUser() {
|
||||
return
|
||||
}
|
||||
|
||||
if organization != nil && user != nil {
|
||||
user, err = object.GetFilteredUser(user, c.IsAdmin(), c.IsAdminOrSelf(user), organization.AccountItems)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
c.ResponseOk(user)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user