Skip to content

Commit

Permalink
Update cloud migrate group backup access denied message
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <[email protected]>
  • Loading branch information
ggriffiths committed Oct 1, 2019
1 parent 8afd2f0 commit 8e92f91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/server/sdk/cloud_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/libopenstorage/openstorage/api"
"github.com/libopenstorage/openstorage/volume"
"github.com/portworx/kvdb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down Expand Up @@ -133,7 +134,11 @@ func (s *CloudBackupServer) GroupCreate(

// Check ownership for this intersection
if err := checkAccessFromDriverForVolumeIds(ctx, s.driver(ctx), volumesToCheck, api.Ownership_Read); err != nil {
return nil, err
if err == kvdb.ErrNotFound {
return nil, err
}

return nil, status.Errorf(codes.PermissionDenied, "Access denied to at least one volume in group %s", req.GetGroupId())
}

// Only a slice of VolumeIDs provided
Expand Down

0 comments on commit 8e92f91

Please sign in to comment.