Fix error on missing permissions for GetBundle

This commit is contained in:
Benedikt Kulmann
2020-08-25 10:40:44 +02:00
parent 27cffac1de
commit c1a4f7a238
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -2,6 +2,7 @@ package svc
import (
"context"
"fmt"
"github.com/golang/protobuf/ptypes/empty"
merrors "github.com/micro/go-micro/v2/errors"
@@ -75,6 +76,7 @@ func (g Service) GetBundle(c context.Context, req *proto.GetBundleRequest, res *
roleIDs := g.getRoleIDs(c, accountUUID)
filteredBundle := g.getFilteredBundle(roleIDs, bundle)
if len(filteredBundle.Settings) == 0 {
err = fmt.Errorf("could not read bundle: %v", req.BundleId)
return merrors.NotFound("ocis-settings", "%s", err)
}
res.Bundle = filteredBundle
+1 -1
View File
@@ -73,7 +73,7 @@ func (s Store) ReadSetting(settingID string) (*proto.Setting, error) {
}
}
}
return nil, fmt.Errorf(settingID, fmt.Sprintf("could not read setting: %v", settingID))
return nil, fmt.Errorf("could not read setting: %v", settingID)
}
// WriteBundle writes the given record into a file within the dataPath.