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, superUserIDs []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 NamespacedNameIDSelector
- type Selectors
- type ViewRef
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 Enforcer ¶
func Enforcer() *casbin.SyncedCachedEnforcer
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 NamespacedNameIDSelector ¶ added in v1.0.1074
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"`
Views []ViewRef `json:"views,omitempty"`
}
Selectors represents the object_selector from a permission and specifies resource selectors for multiple resource types used in ABAC authorization.
For authorization to succeed, all specified resource type selectors must match the corresponding resources in the ABACAttribute. If a selector is specified for a resource type but the attribute lacks that resource, authorization fails. If an attribute provides a resource but no selector exists for that type, the permission is considered non-restrictive for that resource (authorized).
type ViewRef ¶ added in v1.0.1074
type ViewRef NamespacedNameIDSelector
Click to show internal directories.
Click to hide internal directories.