Documentation ¶
Index ¶
Constants ¶
View Source
const ( CONF_PATH = "configs/casbin" RBAC_DEFAULT = "rbac_default" RBAC_DOMAINS = "rbac_domains" RBAC_RESOURCE = "rbac_resource_roles" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasbinService ¶
type CasbinService struct { Type string // 规则类型 DB *gorm.DB // 数据库句柄 Prefix string // 自定义表前缀 TableName string // 自定义表名 }
func (*CasbinService) AddPolicy ¶
func (c *CasbinService) AddPolicy(rivals ...interface{}) bool
AddPolicy 添加策略 sub(角色), obj(路径), act(方法)
func (*CasbinService) Checked ¶
func (c *CasbinService) Checked(rivals ...interface{}) bool
Checked 策略验证 sub(角色), obj(路径), act(方法)
func (*CasbinService) RemovePolicy ¶
func (c *CasbinService) RemovePolicy(rivals ...interface{}) bool
RemovePolicy 删除策略 sub(角色), obj(路径), act(方法)
Click to show internal directories.
Click to hide internal directories.