humingcheng commented on a change in pull request #1029:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1029#discussion_r642282584



##########
File path: server/resource/v4/auth_resource.go
##########
@@ -145,29 +124,16 @@ func (ar *AuthResource) ListAccount(w 
http.ResponseWriter, r *http.Request) {
 }
 
 func (ar *AuthResource) GetAccount(w http.ResponseWriter, r *http.Request) {
-       a, err := dao.GetAccount(r.Context(), r.URL.Query().Get(":name"))
+       a, err := rbacsvc.GetAccount(r.Context(), r.URL.Query().Get(":name"))
        if err != nil {
                log.Error(errorsEx.MsgGetAccountFailed, err)
-               rest.WriteError(w, discovery.ErrInternal, 
errorsEx.MsgGetAccountFailed)
+               writeErrsvcOrInternalErr(w, err)
                return
        }
        a.Password = ""
        rest.WriteResponse(w, r, nil, a)
 }
 
-func (ar *AuthResource) illegalCheck(w http.ResponseWriter, req *http.Request, 
name string) bool {
-       if name == rbacsvc.RootName {
-               rest.WriteError(w, discovery.ErrInvalidParams, 
errorsEx.MsgCantOperateRoot)
-               return true
-       }
-       user := rbacsvc.UserFromContext(req.Context())
-       if name == user {
-               rest.WriteError(w, discovery.ErrInvalidParams, 
errorsEx.MsgCantOperateYour)
-               return true
-       }
-       return false

Review comment:
       
https://github.com/apache/servicecomb-service-center/pull/1029/files#diff-b12045f836975d685f7b9152bef486b33d9dbc2277f228072ab7a226cb4329c7R69-R74




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to