Documentation
¶
Index ¶
- func AddAdapterPolicy(id string, policy ...string) (bool, string)
- func DeleteAdapter(adapter *Adapter) bool
- func DeleteEnforcer(enforcer *Enforcer) bool
- func DeleteModel(model *Model) bool
- func DeletePolicyList(policyList *PolicyList) bool
- func HasGithub(github string) string
- func InitOrmManager()
- func IsUserAdmin(user string) bool
- func LinkUserAccount(Github, Email, Avatar string, IsAdmin bool) bool
- func RemoveAdapterPolicy(id string, policy ...string) (bool, string)
- func SetAdapterAllPolicies(id string, policies []*CasbinRule) (bool, string)
- func UpdateAdapter(adapter *Adapter) bool
- func UpdateAdapters(adapters []*Adapter) bool
- func UpdateEnforcer(enforcer *Enforcer) bool
- func UpdateEnforcers(enforcers []*Enforcer) bool
- func UpdateModel(model *Model) bool
- func UpdateModels(models []*Model) bool
- func UpdatePolicyList(policyList *PolicyList) bool
- type Adapter
- type CasbinRule
- type Enforcer
- type Model
- type OrmManager
- type PolicyList
- type User
- type UserList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAdapter ¶
func DeleteEnforcer ¶
func DeleteModel ¶
func DeletePolicyList ¶
func DeletePolicyList(policyList *PolicyList) bool
func InitOrmManager ¶
func InitOrmManager()
func IsUserAdmin ¶
func LinkUserAccount ¶
func SetAdapterAllPolicies ¶
func SetAdapterAllPolicies(id string, policies []*CasbinRule) (bool, string)
func UpdateAdapter ¶
func UpdateAdapters ¶
func UpdateEnforcer ¶
func UpdateEnforcers ¶
func UpdateModel ¶
func UpdateModels ¶
func UpdatePolicyList ¶
func UpdatePolicyList(policyList *PolicyList) bool
Types ¶
type Adapter ¶
type Adapter struct {
Id string `xorm:"varchar(100) notnull pk" json:"id"`
Name string `xorm:"varchar(100)" json:"name"`
Type string `xorm:"varchar(100)" json:"type"`
Param1 string `xorm:"varchar(500)" json:"param1"`
Param2 string `xorm:"varchar(500)" json:"param2"`
PolicyHeaders []string `json:"policyHeaders"`
}
func GetAdapter ¶
func GetAdapters ¶
func GetAdapters() []*Adapter
func NewAdapter ¶
func NewAdapter() *Adapter
func (*Adapter) TestConnection ¶
type CasbinRule ¶
type CasbinRule struct {
PType string `xorm:"varchar(100) index not null default ''" json:"pType"`
V0 string `xorm:"varchar(100) index not null default ''" json:"v0"`
V1 string `xorm:"varchar(100) index not null default ''" json:"v1"`
V2 string `xorm:"varchar(100) index not null default ''" json:"v2"`
V3 string `xorm:"varchar(100) index not null default ''" json:"v3"`
V4 string `xorm:"varchar(100) index not null default ''" json:"v4"`
V5 string `xorm:"varchar(100) index not null default ''" json:"v5"`
}
func GetAdapterGroupingPolicies ¶
func GetAdapterGroupingPolicies(id string) (bool, string, []*CasbinRule)
func GetAdapterPolicies ¶
func GetAdapterPolicies(id string) (bool, string, []*CasbinRule)
type Enforcer ¶
type Enforcer struct {
Id string `xorm:"varchar(100) notnull pk" json:"id"`
Name string `xorm:"varchar(100)" json:"name"`
Model string `xorm:"varchar(100)" json:"model"`
Adapter string `xorm:"varchar(100)" json:"adapter"`
}
func GetEnforcer ¶
func GetEnforcers ¶
func GetEnforcers() []*Enforcer
func NewEnforcer ¶
func NewEnforcer() *Enforcer
type Model ¶
type OrmManager ¶
type OrmManager struct {
// contains filtered or unexported fields
}
OrmManager represents the MySQL ormManager for policy storage.
func NewOrmManager ¶
func NewOrmManager(driverName string, dataSourceName string) *OrmManager
NewOrmManager is the constructor for OrmManager.
type PolicyList ¶
type PolicyList struct {
Id string `xorm:"varchar(100) notnull pk" json:"id"`
RuleType string `xorm:"varchar(100)" json:"ruleType"`
Tenant string `xorm:"varchar(100)" json:"tenant"`
User string `xorm:"varchar(100)" json:"user"`
ResourcePath string `xorm:"varchar(500)" json:"resourcePath"`
Action string `xorm:"varchar(500)" json:"action"`
Service string `xorm:"varchar(500)" json:"service"`
AuthEffect string `xorm:"varchar(500)" json:"authEffect"`
}
func GetPolicyList ¶
func GetPolicyList(id string) *PolicyList
func GetPolicyLists ¶
func GetPolicyLists() []*PolicyList
func NewPolicyList ¶
func NewPolicyList() *PolicyList
Click to show internal directories.
Click to hide internal directories.