Documentation
¶
Index ¶
- func CanReadResource(ctx context.Context, resource string) (ok bool, err errors.CodeError)
- func CanWriteResource(ctx context.Context, resource string) (ok bool, err errors.CodeError)
- func RemoveRole(ctx context.Context, name string) (err errors.CodeError)
- func SaveRole(ctx context.Context, role Role) (err errors.CodeError)
- func UserBindRoles(ctx context.Context, userId string, roles ...string) (err errors.CodeError)
- func UserUnbindRoles(ctx context.Context, userId string, roles ...string) (err errors.CodeError)
- func Verify(ctx context.Context, roles ...string) (err errors.CodeError)
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanReadResource ¶
func CanWriteResource ¶
func UserBindRoles ¶
func UserUnbindRoles ¶
Types ¶
type Role ¶
type Role interface { Name() string Parent(ctx context.Context) (parent Role, err errors.CodeError) SetParent(parent Role) RemoveParent() Children() []Role AddChild(child Role) RemoveChild(child Role) AddReadableResource(resource string) AddWriteableResource(resource string) AddReadableAndWriteableResource(resource string) Contains(roles []string) (ok bool) CanReadResource(resource string) (ok bool) CanWriteResource(resource string) (ok bool) }
func GetUserRoles ¶
Click to show internal directories.
Click to hide internal directories.