Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Role ¶
type Role struct {
// contains filtered or unexported fields
}
Role represents the data structure for a role in RBAC.
type RoleManager ¶
type RoleManager struct {
// contains filtered or unexported fields
}
RoleManager represents the interface to manage the roles in RBAC.
func NewRoleManager ¶
func NewRoleManager(level int) *RoleManager
NewRoleManager is the constructor for RoleManager.
func (*RoleManager) AddLink ¶
func (rm *RoleManager) AddLink(name1 string, name2 string)
AddLink adds the inheritance link between role: name1 and role: name2. aka role: name1 inherits role: name2.
func (*RoleManager) DeleteLink ¶
func (rm *RoleManager) DeleteLink(name1 string, name2 string)
DeleteLink deletes the inheritance link between role: name1 and role: name2. aka role: name1 does not inherit role: name2 any more.
func (*RoleManager) GetRoles ¶
func (rm *RoleManager) GetRoles(name string) []string
GetRoles gets the roles that a subject inherits.
func (*RoleManager) HasLink ¶
func (rm *RoleManager) HasLink(name1 string, name2 string) bool
HasLink determines whether role: name1 inherits role: name2.
func (*RoleManager) PrintRoles ¶
func (rm *RoleManager) PrintRoles()
PrintRoles prints all the roles to log.
Click to show internal directories.
Click to hide internal directories.