Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AssertionAssignFunc ¶
type AssertionFunc ¶
type AssertionFunc func(RBAC, string, Permission) bool
type Permission ¶ added in v0.5.1
type Permission interface { ID() string Match(Permission) bool MatchID(string) bool }
func NewPermission ¶ added in v0.5.1
func NewPermission(id string) Permission
NewPermission returns a Permission instance with `id`
type Permissions ¶ added in v0.5.1
type Permissions map[string]Permission
type RBAC ¶ added in v0.5.1
type RBAC interface { SetParents(string, []string) error GetParents(string) ([]string, error) SetParent(string, string) error RemoveParent(string, string) error AddRole(Role) error RemoveRole(string) error GetRole(string) (Role, []string, error) GetRoleOnly(string) (Role, error) IsGranted(string, Permission) bool IsGrantedID(string, string) bool IsAssertGranted(string, Permission, AssertionFunc) bool IsAssertGrantedID(string, string, AssertionIDFunc) bool }
type Role ¶ added in v0.5.1
type Role interface { ID() string Tag() string Assign(Permission) error AssignID(string) error AssertAssignIDs([]string, AssertionAssignFunc) Revoke(Permission) error RevokeID(string) error Permit(Permission) bool PermitID(string) bool Permissions() []Permission PermissionIDs() []string Sign(string) string }
Click to show internal directories.
Click to hide internal directories.