mirror of
https://github.com/documize/community.git
synced 2025-07-22 06:39:43 +02:00
moved user.active to account.active
This commit is contained in:
parent
af80b39cd0
commit
5f2f9d5ae5
4 changed files with 21 additions and 17 deletions
|
@ -441,6 +441,7 @@ func UpdateUser(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
account.Editor = user.Editor
|
||||
account.Admin = user.Admin
|
||||
account.Active = user.Active
|
||||
|
||||
err = p.UpdateAccount(account)
|
||||
if err != nil {
|
||||
|
@ -690,11 +691,13 @@ func attachUserAccounts(p request.Persister, orgID string, user *entity.User) {
|
|||
user.Accounts = a
|
||||
user.Editor = false
|
||||
user.Admin = false
|
||||
user.Active = false
|
||||
|
||||
for _, account := range user.Accounts {
|
||||
if account.OrgID == orgID {
|
||||
user.Admin = account.Admin
|
||||
user.Editor = account.Editor
|
||||
user.Active = account.Active
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue