Documentation ¶
Index ¶
- Constants
- func RegisterStore(s Store)
- func Service() (v service.Service)
- type BindArgument
- type BindsArgument
- type ChildrenArgument
- type EnforceArgument
- type EnforceResult
- type Policy
- type PolicyRecord
- type RemoveArgument
- type Role
- type RoleArgument
- type RoleRecord
- type RolesArgument
- type SaveArgument
- type Store
- type StoreOptions
- type UnbindArgument
Constants ¶
View Source
const ( Name = "rbac" RoleFn = "role" RolesFn = "roles" ChildrenFn = "children" SaveFn = "save" RemoveFn = "remove" BindFn = "bind" UnbindFn = "unbind" BindsFn = "binds" EnforceFn = "enforce" )
Variables ¶
This section is empty.
Functions ¶
func RegisterStore ¶
func RegisterStore(s Store)
Types ¶
type BindArgument ¶
type BindsArgument ¶
type ChildrenArgument ¶
type EnforceArgument ¶
type EnforceResult ¶
type EnforceResult struct {
Pass bool `json:"pass"`
}
type PolicyRecord ¶
type RemoveArgument ¶
type RemoveArgument struct {
Code string `json:"code"`
}
type RoleArgument ¶
type RoleRecord ¶
type RoleRecord struct { Code string `json:"code"` Name string `json:"name"` Description string `json:"description"` Parent string `json:"parent"` Policies []*PolicyRecord `json:"policies"` }
type RolesArgument ¶
type RolesArgument struct {
Flat bool `json:"flat"`
}
type SaveArgument ¶
type Store ¶
type Store interface { Build(options StoreOptions) (err error) Role(ctx context.Context, code string) (role *RoleRecord, err error) Roles(ctx context.Context) (roles []*RoleRecord, err error) Children(ctx context.Context, parent string) (children []*RoleRecord, err error) SaveRole(ctx context.Context, role *RoleRecord) (err error) RemoveRole(ctx context.Context, role *RoleRecord) (err error) Binds(ctx context.Context, subject string) (roles []*RoleRecord, err error) Bind(ctx context.Context, subject string, roles []*RoleRecord) (err error) Unbind(ctx context.Context, subject string, roles []*RoleRecord) (err error) Close() (err error) }
type StoreOptions ¶
type StoreOptions struct { Log logs.Logger Config configures.Config }
type UnbindArgument ¶
Click to show internal directories.
Click to hide internal directories.