Documentation ¶
Index ¶
- func NewRoleManager(maxHierarchyLevel int) rbac.RoleManager
- type RoleManager
- func (rm *RoleManager) AddLink(name1 string, name2 string, timeRange ...string) error
- func (rm *RoleManager) Clear() error
- func (rm *RoleManager) DeleteLink(name1 string, name2 string, unused ...string) error
- func (rm *RoleManager) GetRoles(name string, currentTime ...string) ([]string, error)
- func (rm *RoleManager) GetUsers(name string, currentTime ...string) ([]string, error)
- func (rm *RoleManager) HasLink(name1 string, name2 string, requestTime ...string) (bool, error)
- func (rm *RoleManager) PrintRoles() error
- type Session
- type SessionRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRoleManager ¶
func NewRoleManager(maxHierarchyLevel int) rbac.RoleManager
NewRoleManager is the constructor for creating an instance of the SessionRoleManager implementation.
Types ¶
type RoleManager ¶
type RoleManager struct {
// contains filtered or unexported fields
}
func (*RoleManager) AddLink ¶
func (rm *RoleManager) AddLink(name1 string, name2 string, timeRange ...string) error
AddLink adds the inheritance link between role: name1 and role: name2. aka role: name1 inherits role: name2. timeRange is the time range when the role inheritance link is active.
func (*RoleManager) Clear ¶
func (rm *RoleManager) Clear() error
Clear clears all stored data and resets the role manager to the initial state.
func (*RoleManager) DeleteLink ¶
func (rm *RoleManager) DeleteLink(name1 string, name2 string, unused ...string) error
DeleteLink deletes the inheritance link between role: name1 and role: name2. aka role: name1 does not inherit role: name2 any more. unused is not used.
func (*RoleManager) GetRoles ¶
func (rm *RoleManager) GetRoles(name string, currentTime ...string) ([]string, error)
GetRoles gets the roles that a subject inherits. currentTime is the querying time for the role inheritance link.
func (*RoleManager) GetUsers ¶
func (rm *RoleManager) GetUsers(name string, currentTime ...string) ([]string, error)
GetUsers gets the users that inherits a subject. currentTime is the querying time for the role inheritance link.
func (*RoleManager) HasLink ¶
HasLink determines whether role: name1 inherits role: name2. requestTime is the querying time for the role inheritance link.
func (*RoleManager) PrintRoles ¶
func (rm *RoleManager) PrintRoles() error
PrintRoles prints all the roles to log.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents the activation of a role inheritance for a specified time. A role inheritance is always bound to its temporal validity. As soon as a session loses its validity, the corresponding role inheritance becomes invalid too.
type SessionRole ¶
type SessionRole struct {
// contains filtered or unexported fields
}
SessionRole is a modified version of the default role. A SessionRole not only has a name, but also a list of sessions.