mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
Fix owner bug in GetUser().
This commit is contained in:
@ -85,11 +85,14 @@ func (c *ApiController) GetUsers() {
|
|||||||
// @router /get-user [get]
|
// @router /get-user [get]
|
||||||
func (c *ApiController) GetUser() {
|
func (c *ApiController) GetUser() {
|
||||||
id := c.Input().Get("id")
|
id := c.Input().Get("id")
|
||||||
owner := c.Input().Get("owner")
|
|
||||||
email := c.Input().Get("email")
|
email := c.Input().Get("email")
|
||||||
userOwner, _ := util.GetOwnerAndNameFromId(id)
|
|
||||||
organization := object.GetOrganization(fmt.Sprintf("%s/%s", "admin", userOwner))
|
|
||||||
|
|
||||||
|
owner := c.Input().Get("owner")
|
||||||
|
if owner == "" {
|
||||||
|
owner, _ = util.GetOwnerAndNameFromId(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
organization := object.GetOrganization(fmt.Sprintf("%s/%s", "admin", owner))
|
||||||
if !organization.IsProfilePublic {
|
if !organization.IsProfilePublic {
|
||||||
requestUserId := c.GetSessionUsername()
|
requestUserId := c.GetSessionUsername()
|
||||||
hasPermission, err := object.CheckUserPermission(requestUserId, id, false)
|
hasPermission, err := object.CheckUserPermission(requestUserId, id, false)
|
||||||
|
Reference in New Issue
Block a user