fixed doc env vars + mongo v2 migration
This commit is contained in:
@@ -28,7 +28,7 @@ import (
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
mutil "github.com/tech/sendico/pkg/mutil/db"
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -40,7 +40,7 @@ import (
|
||||
func GetAccountBoundObjects[T any](
|
||||
ctx context.Context,
|
||||
logger mlogger.Logger,
|
||||
accountRef, organizationRef primitive.ObjectID,
|
||||
accountRef, organizationRef bson.ObjectID,
|
||||
filter builder.Query,
|
||||
cursor *model.ViewCursor,
|
||||
enforcer auth.Enforcer,
|
||||
@@ -70,7 +70,7 @@ func GetAccountBoundObjects[T any](
|
||||
return nil, merrors.NoData("no_account_bound_objects_found")
|
||||
}
|
||||
|
||||
allowed := make([]primitive.ObjectID, 0, len(allObjects))
|
||||
allowed := make([]bson.ObjectID, 0, len(allObjects))
|
||||
for _, ref := range allObjects {
|
||||
allowed = append(allowed, *ref.GetID())
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@ import (
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
mutil "github.com/tech/sendico/pkg/mutil/db"
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func GetProtectedObjects[T any](
|
||||
ctx context.Context,
|
||||
logger mlogger.Logger,
|
||||
accountRef, organizationRef primitive.ObjectID,
|
||||
accountRef, organizationRef bson.ObjectID,
|
||||
action model.Action,
|
||||
filter builder.Query,
|
||||
cursor *model.ViewCursor,
|
||||
@@ -44,7 +44,7 @@ func GetProtectedObjects[T any](
|
||||
return nil, err
|
||||
}
|
||||
|
||||
allowed := make([]primitive.ObjectID, 0, len(res))
|
||||
allowed := make([]bson.ObjectID, 0, len(res))
|
||||
for _, ref := range refs {
|
||||
if ok := res[*ref.GetID()]; ok {
|
||||
allowed = append(allowed, *ref.GetID())
|
||||
|
||||
Reference in New Issue
Block a user