@@ -20,8 +20,8 @@ import (
2020 core "github.com/gitopia/git-remote-gitopia/core"
2121 "github.com/gitopia/git-remote-gitopia/core/api"
2222 "github.com/gitopia/git-remote-gitopia/core/wallet"
23- gitopiatypes "github.com/gitopia/gitopia/v4 /x/gitopia/types"
24- "github.com/gitopia/gitopia/v4 /x/gitopia/utils"
23+ gitopiatypes "github.com/gitopia/gitopia/v5 /x/gitopia/types"
24+ "github.com/gitopia/gitopia/v5 /x/gitopia/utils"
2525 "github.com/go-git/go-git/v5/plumbing"
2626 "github.com/pkg/errors"
2727 "google.golang.org/grpc"
@@ -360,15 +360,18 @@ func (h *GitopiaHandler) havePushPermission(walletAddress string) (havePermissio
360360 havePermission = true
361361 }
362362 } else if h .remoteRepository .Owner .Type == gitopiatypes .OwnerType_DAO {
363- member , err := h .queryClient .DaoMember (context .Background (), & gitopiatypes.QueryGetDaoMemberRequest {
364- DaoId : h .remoteRepository .Owner .Id ,
365- UserId : h .wallet .Address (),
363+ resp , err := h .queryClient .DaoMemberAll (context .Background (), & gitopiatypes.QueryAllDaoMemberRequest {
364+ DaoId : h .remoteRepository .Owner .Id ,
366365 })
367366 if err != nil {
368367 return havePermission , err
369368 }
370- if member .Member .Role == gitopiatypes .MemberRole_OWNER {
371- havePermission = true
369+
370+ for _ , member := range resp .Members {
371+ if member .Member .Address == walletAddress {
372+ havePermission = true
373+ break
374+ }
372375 }
373376 }
374377
0 commit comments