Documentation ¶
Index ¶
- Variables
- func EmptyDatastore(ds datastore.Datastore, require *require.Assertions) (datastore.Datastore, datastore.Revision)
- func NewValidatingDatastore(delegate datastore.Datastore) datastore.Datastore
- func StandardDatastoreWithData(ds datastore.Datastore, require *require.Assertions) (datastore.Datastore, datastore.Revision)
- func StandardDatastoreWithSchema(ds datastore.Datastore, require *require.Assertions) (datastore.Datastore, datastore.Revision)
- type TupleChecker
- func (tc TupleChecker) ExactRelationshipIterator(ctx context.Context, tpl *core.RelationTuple, rev datastore.Revision) datastore.RelationshipIterator
- func (tc TupleChecker) NoTupleExists(ctx context.Context, tpl *core.RelationTuple, rev datastore.Revision)
- func (tc TupleChecker) TupleExists(ctx context.Context, tpl *core.RelationTuple, rev datastore.Revision)
- func (tc TupleChecker) VerifyIteratorCount(iter datastore.RelationshipIterator, count int)
- func (tc TupleChecker) VerifyIteratorResults(iter datastore.RelationshipIterator, tpls ...*core.RelationTuple)
Constants ¶
This section is empty.
Variables ¶
View Source
var DocumentNS = ns.Namespace( "document", ns.Relation("owner", nil, ns.AllowedRelation("user", "..."), ), ns.Relation("editor", nil, ns.AllowedRelation("user", "..."), ), ns.Relation("viewer", nil, ns.AllowedRelation("user", "..."), ), ns.Relation("viewer_and_editor", nil, ns.AllowedRelation("user", "..."), ), ns.Relation("parent", nil, ns.AllowedRelation("folder", "...")), ns.Relation("edit", ns.Union( ns.ComputedUserset("owner"), ns.ComputedUserset("editor"), ), ), ns.Relation("view", ns.Union( ns.ComputedUserset("viewer"), ns.ComputedUserset("edit"), ns.TupleToUserset("parent", "view"), ), ), ns.Relation("view_and_edit", ns.Intersection( ns.ComputedUserset("viewer_and_editor"), ns.ComputedUserset("edit"), ), ), )
View Source
var FolderNS = ns.Namespace( "folder", ns.Relation("owner", nil, ns.AllowedRelation("user", "..."), ), ns.Relation("editor", nil, ns.AllowedRelation("user", "..."), ), ns.Relation("viewer", nil, ns.AllowedRelation("user", "..."), ns.AllowedRelation("folder", "viewer"), ), ns.Relation("parent", nil, ns.AllowedRelation("folder", "...")), ns.Relation("edit", ns.Union( ns.ComputedUserset("editor"), ns.ComputedUserset("owner"), ), ), ns.Relation("view", ns.Union( ns.ComputedUserset("viewer"), ns.ComputedUserset("edit"), ns.TupleToUserset("parent", "view"), ), ), )
View Source
var StandardTuples = []string{
"document:companyplan#parent@folder:company#...",
"document:masterplan#parent@folder:strategy#...",
"folder:strategy#parent@folder:company#...",
"folder:company#owner@user:owner#...",
"folder:company#viewer@user:legal#...",
"folder:strategy#owner@user:vp_product#...",
"document:masterplan#owner@user:product_manager#...",
"document:masterplan#viewer@user:eng_lead#...",
"document:masterplan#parent@folder:plans#...",
"folder:plans#viewer@user:chief_financial_officer#...",
"folder:auditors#viewer@user:auditor#...",
"folder:company#viewer@folder:auditors#viewer",
"document:healthplan#parent@folder:plans#...",
"folder:isolated#viewer@user:villain#...",
"document:specialplan#viewer_and_editor@user:multiroleguy#...",
"document:specialplan#editor@user:multiroleguy#...",
"document:specialplan#viewer_and_editor@user:missingrolegal#...",
}
View Source
var UserNS = ns.Namespace("user")
Functions ¶
func EmptyDatastore ¶ added in v1.5.0
func NewValidatingDatastore ¶ added in v0.0.2
NewValidatingDatastore creates a proxy which runs validation on all call parameters before passing the call onward.
Types ¶
type TupleChecker ¶
type TupleChecker struct { Require *require.Assertions DS datastore.Datastore }
func (TupleChecker) ExactRelationshipIterator ¶ added in v1.8.0
func (tc TupleChecker) ExactRelationshipIterator(ctx context.Context, tpl *core.RelationTuple, rev datastore.Revision) datastore.RelationshipIterator
func (TupleChecker) NoTupleExists ¶
func (tc TupleChecker) NoTupleExists(ctx context.Context, tpl *core.RelationTuple, rev datastore.Revision)
func (TupleChecker) TupleExists ¶
func (tc TupleChecker) TupleExists(ctx context.Context, tpl *core.RelationTuple, rev datastore.Revision)
func (TupleChecker) VerifyIteratorCount ¶
func (tc TupleChecker) VerifyIteratorCount(iter datastore.RelationshipIterator, count int)
func (TupleChecker) VerifyIteratorResults ¶
func (tc TupleChecker) VerifyIteratorResults(iter datastore.RelationshipIterator, tpls ...*core.RelationTuple)
Click to show internal directories.
Click to hide internal directories.