Documentation ¶
Index ¶
- type Cache
- func (c *Cache) AssignableRelations(on, sn ObjectName, sr ...RelationName) ([]RelationName, error)
- func (c *Cache) CanUpdate(other *model.Model, stats *stts.Stats) error
- func (c *Cache) Check(req *dsr.CheckRequest, relReader graph.RelationReader) (*dsr.CheckResponse, error)
- func (c *Cache) GetGraph(req *dsr.GetGraphRequest, relReader graph.RelationReader) (*dsr.GetGraphResponse, error)
- func (c *Cache) Metadata() *model.Metadata
- func (c *Cache) ObjectExists(on ObjectName) bool
- func (c *Cache) PermissionExists(on ObjectName, pn RelationName) bool
- func (c *Cache) RelationExists(on ObjectName, rn RelationName) bool
- func (c *Cache) UpdateModel(m *model.Model) error
- func (c *Cache) ValidateRelation(relation *dsc.Relation) error
- type ObjectName
- type RelationName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) AssignableRelations ¶ added in v0.2.0
func (c *Cache) AssignableRelations(on, sn ObjectName, sr ...RelationName) ([]RelationName, error)
AssignableRelations returns the set of relations that can occur between a given object type and a subject type, optionally with a subject relation.
If more than one subject relation is provided, AssignableRelations returns relations that match any of the given relations. For example, if the manifest has:
types:
tenant: relations: admin: group#member guest: group#guest
Then AssignableRelations("tenant", "group", "member", "guest") returns ["admin", "guest"].
func (*Cache) Check ¶ added in v0.1.0
func (c *Cache) Check(req *dsr.CheckRequest, relReader graph.RelationReader) (*dsr.CheckResponse, error)
func (*Cache) GetGraph ¶ added in v0.1.1
func (c *Cache) GetGraph(req *dsr.GetGraphRequest, relReader graph.RelationReader) (*dsr.GetGraphResponse, error)
func (*Cache) ObjectExists ¶
func (c *Cache) ObjectExists(on ObjectName) bool
ObjectExists, checks if given object type name exists in the model cache.
func (*Cache) PermissionExists ¶
func (c *Cache) PermissionExists(on ObjectName, pn RelationName) bool
PermissionExists, checks if given permission, for the given object type, exists in the model cache.
func (*Cache) RelationExists ¶
func (c *Cache) RelationExists(on ObjectName, rn RelationName) bool
RelationExists, checks if given relation type, for the given object type, exists in the model cache.
func (*Cache) UpdateModel ¶
UpdateModel, swaps the cache model instance.
type ObjectName ¶ added in v0.2.0
type ObjectName = model.ObjectName
type RelationName ¶ added in v0.2.0
type RelationName = model.RelationName