···6868// - this handler should calculate the diff in order to create the labelop record
6969// - we need the diff in order to maintain a "history" of operations performed by users
7070func (l *Labels) PerformLabelOp(w http.ResponseWriter, r *http.Request) {
7171- user := l.oauth.GetUser(r)
7171+ user := l.oauth.GetMultiAccountUser(r)
72727373 noticeId := "add-label-error"
7474···8282 return
8383 }
84848585- did := user.Did
8585+ did := user.Active.Did
8686 rkey := tid.TID()
8787 performedAt := time.Now()
8888 indexedAt := time.Now()
···115115 return func(next http.Handler) http.Handler {
116116 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
117117 // requires auth also
118118- actor := mw.oauth.GetUser(r)
118118+ actor := mw.oauth.GetMultiAccountUser(r)
119119 if actor == nil {
120120 // we need a logged in user
121121 log.Printf("not logged in, redirecting")
···128128 return
129129 }
130130131131- ok, err := mw.enforcer.E.HasGroupingPolicy(actor.Did, group, domain)
131131+ ok, err := mw.enforcer.E.HasGroupingPolicy(actor.Active.Did, group, domain)
132132 if err != nil || !ok {
133133- // we need a logged in user
134134- log.Printf("%s does not have perms of a %s in domain %s", actor.Did, group, domain)
133133+ log.Printf("%s does not have perms of a %s in domain %s", actor.Active.Did, group, domain)
135134 http.Error(w, "Forbiden", http.StatusUnauthorized)
136135 return
137136 }
···149148 return func(next http.Handler) http.Handler {
150149 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
151150 // requires auth also
152152- actor := mw.oauth.GetUser(r)
151151+ actor := mw.oauth.GetMultiAccountUser(r)
153152 if actor == nil {
154153 // we need a logged in user
155154 log.Printf("not logged in, redirecting")
···162161 return
163162 }
164163165165- ok, err := mw.enforcer.E.Enforce(actor.Did, f.Knot, f.DidSlashRepo(), requiredPerm)
164164+ ok, err := mw.enforcer.E.Enforce(actor.Active.Did, f.Knot, f.DidSlashRepo(), requiredPerm)
166165 if err != nil || !ok {
167167- // we need a logged in user
168168- log.Printf("%s does not have perms of a %s in repo %s", actor.Did, requiredPerm, f.DidSlashRepo())
166166+ log.Printf("%s does not have perms of a %s in repo %s", actor.Active.Did, requiredPerm, f.DidSlashRepo())
169167 http.Error(w, "Forbiden", http.StatusUnauthorized)
170168 return
171169 }