service backend
All checks were successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful

This commit is contained in:
Stephan D
2025-11-07 18:35:26 +01:00
parent 20e8f9acc4
commit 62a6631b9a
537 changed files with 48453 additions and 0 deletions

32
api/pkg/model/pbinding.go Normal file
View File

@@ -0,0 +1,32 @@
package model
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ScopeMode string
const (
ScopeAll ScopeMode = "all" // apply to all of that type
ScopeOnly ScopeMode = "only" // only listed IDs
ScopeAllExcept ScopeMode = "all_except" // all minus listed IDs
)
type TargetScope struct {
ObjectRefs `bson:"target" json:"target"`
Mode ScopeMode `bson:"mode" json:"mode"`
}
type PropertyInstance struct {
Global bool `bson:"global" json:"global"` // Property has single value for all property users
Required bool `bson:"required" json:"required"` // Presence requirement (works for One and Many).
UniqueAcrossEntities bool `bson:"uniqueAcrossEntities" json:"uniqueAcrossEntities"` // Uniqueness across ENTITIES (DB-level concern; enforce in assignments collection).
PropertySchemaRef primitive.ObjectID `bson:"propertySchemaRef" json:"propertySchemaRef"`
}
type PropertiesBinding struct {
PermissionBound `bson:"inline" json:"inline"`
Scope TargetScope `bson:"scope" json:"scope"`
Bindings []PropertyInstance `bson:"bindings" json:"bindings"`
ApplicableScopes []TargetScope `bson:"applicableScopes" json:"applicableScopes"`
}