Documentation ¶
Index ¶
- type Cache
- func (c *Cache) ExpandPermission(on model.ObjectName, pn model.PermissionName) []model.RelationName
- func (c *Cache) ExpandRelation(on model.ObjectName, rn model.RelationName) []model.RelationName
- func (c *Cache) GetObjectType(objectType string) (*dsc2.ObjectType, error)
- func (c *Cache) GetObjectTypes() ([]*dsc2.ObjectType, error)
- func (c *Cache) GetPermission(permission string) (*dsc2.Permission, error)
- func (c *Cache) GetPermissions() ([]*dsc2.Permission, error)
- func (c *Cache) GetRelationType(objectType, relation string) (*dsc2.RelationType, error)
- func (c *Cache) GetRelationTypes(objectType string) ([]*dsc2.RelationType, error)
- func (c *Cache) ObjectExists(on model.ObjectName) bool
- func (c *Cache) PermissionExists(on model.ObjectName, pn model.PermissionName) bool
- func (c *Cache) RelationExists(on model.ObjectName, rn model.RelationName) bool
- func (c *Cache) UpdateModel(m *model.Model) error
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) ExpandPermission ¶
func (c *Cache) ExpandPermission(on model.ObjectName, pn model.PermissionName) []model.RelationName
ExpandPermission returns list of relations which cover the given permission for the given object type.
func (*Cache) ExpandRelation ¶
func (c *Cache) ExpandRelation(on model.ObjectName, rn model.RelationName) []model.RelationName
ExpandRelation, returns list of relations which are a union of the given relation. For example, when a writer relation inherits reader, the expansion of a reader = reader + writer.
func (*Cache) GetObjectType ¶
func (c *Cache) GetObjectType(objectType string) (*dsc2.ObjectType, error)
GetObjectType, v2 backwards-compatibility accessor function, returns v2 ObjectType by name.
func (*Cache) GetObjectTypes ¶
func (c *Cache) GetObjectTypes() ([]*dsc2.ObjectType, error)
GetObjectTypes, v2 backwards-compatibility accessor function, returns list of v2.ObjectType instances.
func (*Cache) GetPermission ¶
func (c *Cache) GetPermission(permission string) (*dsc2.Permission, error)
GetPermission, v2 backwards-compatibility accessor function, returns v2 Permission by permission name.
func (*Cache) GetPermissions ¶
func (c *Cache) GetPermissions() ([]*dsc2.Permission, error)
GetPermissions, v2 backwards-compatibility accessor function, returns list of v2 Permission instances.
func (*Cache) GetRelationType ¶
func (c *Cache) GetRelationType(objectType, relation string) (*dsc2.RelationType, error)
GetRelationType, v2 backwards-compatibility accessor function, returns v2 RelationType by object type and relation name.
func (*Cache) GetRelationTypes ¶
func (c *Cache) GetRelationTypes(objectType string) ([]*dsc2.RelationType, error)
GetRelationTypes, v2 backwards-compatibility accessor function, returns list of v2 RelationType instances, optionally filtered by by object type.
func (*Cache) ObjectExists ¶
func (c *Cache) ObjectExists(on model.ObjectName) bool
ObjectExists, checks if given object type name exists in the model cache.
func (*Cache) PermissionExists ¶
func (c *Cache) PermissionExists(on model.ObjectName, pn model.PermissionName) bool
PermissionExists, checks if given permission, for the given object type, exists in the model cache.
func (*Cache) RelationExists ¶
func (c *Cache) RelationExists(on model.ObjectName, rn model.RelationName) bool
RelationExists, checks if given relation type, for the given object type, exists in the model cache.