You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/11/11 09:00:03 UTC

[GitHub] [servicecomb-kie] little-cui commented on a diff in pull request #265: Dev

little-cui commented on code in PR #265:
URL: https://github.com/apache/servicecomb-kie/pull/265#discussion_r1020008474


##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -54,8 +56,14 @@ func (s *Dao) GetHistory(ctx context.Context, kvID, project, domain string, opti
 		}
 		histories = append(histories, &doc)
 	}
+
+	filterKVs, err := auth.FilterKVList(ctx, histories)

Review Comment:
   按获取单个kv的权限判断,如果没有权限应该是返回401,而不是过滤历史列表



##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -132,6 +145,10 @@ func (s *Dao) historyRotate(ctx context.Context, kvID, project, domain string) e
 func DeleteMany(ctx context.Context, kvs []*model.KVDoc) error {
 	var opts []etcdadpt.OpOptions
 	for _, kv := range kvs {
+		if err := auth.CheckDeleteKV(ctx, kv); err != nil {

Review Comment:
   无需判断权限



##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -80,11 +88,16 @@ func pagingResult(histories []*model.KVDoc, offset, limit int64) []*model.KVDoc
 
 // AddHistory add kv history
 func (s *Dao) AddHistory(ctx context.Context, kv *model.KVDoc) error {
+	if err := auth.CheckCreateKV(ctx, kv); err != nil {

Review Comment:
   无需判断权限



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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