Documentation
¶
Index ¶
- func Create() *casbin.Enforcer
- func DeleteRoleForUser(user string, role string) bool
- func GetAllSubjects() []string
- func GetRolesForUser(user string) ([]string, error)
- func GetUserByRole(role string) ([]string, error)
- func LoadPolicy()
- type Action
- type Object
- type Policy
- type PolicyType
- type Resource
- type Subject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRoleForUser ¶
func GetAllSubjects ¶
func GetAllSubjects() []string
func GetRolesForUser ¶
func GetUserByRole ¶
func LoadPolicy ¶
func LoadPolicy()
Types ¶
type Policy ¶
type Policy struct {
Type PolicyType `json:"type"`
Sub Subject `json:"sub"`
Res Resource `json:"res"`
Act Action `json:"act"`
Obj Object `json:"obj"`
}
func RemovePolicy ¶
type PolicyType ¶
type PolicyType string
Click to show internal directories.
Click to hide internal directories.