31 lines
1.1 KiB
Go
31 lines
1.1 KiB
Go
package policy
|
|
|
|
import (
|
|
"cloud.o-forge.io/core/oc-lib/models/utils"
|
|
"cloud.o-forge.io/core/oc-lib/tools"
|
|
)
|
|
|
|
// Policy defines which inbound libp2p streams are authorized for a peer.
|
|
// Vital streams (planner, considers, minio/admiralty config, source-presign,
|
|
// verify, observe, heartbeat) are always allowed regardless of policy.
|
|
type Policy struct {
|
|
utils.AbstractObject
|
|
|
|
// Resource CRUD
|
|
AllowSearch bool `json:"allow_search" bson:"allow_search"`
|
|
AllowCreate bool `json:"allow_create" bson:"allow_create"`
|
|
AllowUpdate bool `json:"allow_update" bson:"allow_update"`
|
|
AllowDelete bool `json:"allow_delete" bson:"allow_delete"`
|
|
|
|
// Resource freshness tracking
|
|
AllowRegisterWatcher bool `json:"allow_register_watcher" bson:"allow_register_watcher"`
|
|
AllowUnregisterWatcher bool `json:"allow_unregister_watcher" bson:"allow_unregister_watcher"`
|
|
|
|
// Organization partner confirmation
|
|
AllowOrgPartnerConfirm bool `json:"allow_org_partner_confirm" bson:"allow_org_partner_confirm"`
|
|
}
|
|
|
|
func (p *Policy) GetAccessor(request *tools.APIRequest) utils.Accessor {
|
|
return NewAccessor(request)
|
|
}
|