service backend
This commit is contained in:
32
api/pkg/model/pbinding.go
Normal file
32
api/pkg/model/pbinding.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user