Documentation
¶
Index ¶
- Variables
- func AddCustomFunctions(enforcer addableEnforcer)
- func AddRoleForUser(user string, role ...string) error
- func Check(ctx context.Context, subject, object, action string) bool
- func CheckContext(ctx context.Context, object, action string) bool
- func DeleteAllRolesForUser(user string) error
- func DeleteRole(role string) (bool, error)
- func DeleteRoleForUser(user string, role string) error
- func Enforcer() *casbin.SyncedCachedEnforcer
- func GetActionFromHttpMethod(method string) string
- func GetObjectByTable(resource string) string
- func HasPermission(ctx context.Context, subject string, attr *models.ABACAttribute, action string) bool
- func Init(ctx context.Context, adminUserID string, adapters ...Adapter) error
- func PermsForUser(user string) ([]policy.Permission, error)
- func ReloadPolicy() error
- func RolesForUser(user string) ([]string, error)
- func Stop()
- type Adapter
- type Selectors
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultModel string
Functions ¶
func AddCustomFunctions ¶ added in v1.0.840
func AddCustomFunctions(enforcer addableEnforcer)
func AddRoleForUser ¶
func CheckContext ¶ added in v1.0.841
func DeleteAllRolesForUser ¶
func DeleteRole ¶
func DeleteRoleForUser ¶
func GetActionFromHttpMethod ¶
func GetObjectByTable ¶
func HasPermission ¶ added in v1.0.841
func PermsForUser ¶
func PermsForUser(user string) ([]policy.Permission, error)
func ReloadPolicy ¶
func ReloadPolicy() error
func RolesForUser ¶
Types ¶
type Selectors ¶ added in v1.0.840
type Selectors struct { Playbooks []types.ResourceSelector `json:"playbooks,omitempty"` Connections []types.ResourceSelector `json:"connections,omitempty"` Configs []types.ResourceSelector `json:"configs,omitempty"` Components []types.ResourceSelector `json:"components,omitempty"` }
func (Selectors) RequiredMatchCount ¶ added in v1.0.840
Click to show internal directories.
Click to hide internal directories.