data

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFoundError = errors.New("object not found")
)

Functions

This section is empty.

Types

type GroupsModel

type GroupsModel struct {
	ModelId string
	Groups  []group `json:"groups"`
	// contains filtered or unexported fields
}

func NewGroupsModel

func NewGroupsModel(modelId string, content string) (*GroupsModel, error)

func (*GroupsModel) AddGroupPolicy

func (g *GroupsModel) AddGroupPolicy(polType, groupType string, line []string)

func (*GroupsModel) GetGroupPolicyString

func (g *GroupsModel) GetGroupPolicyString() string

func (*GroupsModel) GetGroupPolicyStringArray

func (g *GroupsModel) GetGroupPolicyStringArray() *[]string

func (*GroupsModel) GetJson

func (g *GroupsModel) GetJson() (string, error)

func (*GroupsModel) IsChanged

func (g *GroupsModel) IsChanged() bool

type Model

type Model struct {
	Name        string `json:"name"`
	Id          string `json:"id"`
	Content     string `json:"content"`
	Description string `json:"description"`
}

func (*Model) GetCasbinModel

func (m *Model) GetCasbinModel() (model.Model, error)

type Models

type Models struct {
	Models []Model `json:"models"`
}

func NewModels

func NewModels(content string) (*Models, error)

func (*Models) GetCasbinModelById

func (m *Models) GetCasbinModelById(id string) (*model.Model, error)

func (*Models) GetCasbinModelByName

func (m *Models) GetCasbinModelByName(name string) (*model.Model, error)

func (*Models) GetModelById

func (m *Models) GetModelById(id string) (*Model, error)

func (*Models) GetModelByName

func (m *Models) GetModelByName(name string) (*Model, error)

type UserGroups

type UserGroups struct {
	Type  string `json:"type"`
	Group string `json:"name"`
}

func (*UserGroups) GetString

func (u *UserGroups) GetString(userName string) string

type UserPolicies

type UserPolicies struct {
	Pols []UserPolicyContainer `json:"models"`
	// contains filtered or unexported fields
}

func NewUserPolicies

func NewUserPolicies(userId, content string) (*UserPolicies, error)

func (*UserPolicies) GetJson

func (u *UserPolicies) GetJson() (string, error)

func (*UserPolicies) GetUserPolicy

func (u *UserPolicies) GetUserPolicy(modelID string) (*UserPolicyContainer, error)

func (*UserPolicies) IsChanged

func (u *UserPolicies) IsChanged() bool

type UserPolicy

type UserPolicy struct {
	Type string   `json:"type"`
	Vars []string `json:"vars"`
}

func (*UserPolicy) GetString

func (u *UserPolicy) GetString(userName string) string

type UserPolicyContainer

type UserPolicyContainer struct {
	Id     string       `json:"id"`
	Policy []UserPolicy `json:"policy"`
	Groups []UserGroups `json:"groups"`
	// contains filtered or unexported fields
}

func (*UserPolicyContainer) AddGroupDefinition

func (u *UserPolicyContainer) AddGroupDefinition(typ, name string)

func (*UserPolicyContainer) AddPolicyDefinition

func (u *UserPolicyContainer) AddPolicyDefinition(typ string, vars []string)

func (*UserPolicyContainer) GetGroupString

func (u *UserPolicyContainer) GetGroupString() string

func (*UserPolicyContainer) GetGroupStringArray

func (u *UserPolicyContainer) GetGroupStringArray() []string

func (*UserPolicyContainer) GetPolicyString

func (u *UserPolicyContainer) GetPolicyString() string

func (*UserPolicyContainer) GetPolicyStringArray

func (u *UserPolicyContainer) GetPolicyStringArray() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL