defaultrolemanager

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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 default RoleManager implementation.

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
}
func (rm *RoleManager) AddLink(name1 string, name2 string, domain ...string)

AddLink adds the inheritance link between role: name1 and role: name2. aka role: name1 inherits role: name2. domain is a prefix to the roles.

func (*RoleManager) Clear

func (rm *RoleManager) Clear()

Clear clears all stored data and resets the role manager to the initial state.

func (rm *RoleManager) DeleteLink(name1 string, name2 string, domain ...string)

DeleteLink deletes the inheritance link between role: name1 and role: name2. aka role: name1 does not inherit role: name2 any more. domain is a prefix to the roles.

func (*RoleManager) GetRoles

func (rm *RoleManager) GetRoles(name string, domain ...string) []string

GetRoles gets the roles that a subject inherits. domain is a prefix to the roles.

func (*RoleManager) GetUsers

func (rm *RoleManager) GetUsers(name string, domain ...string) []string

GetUsers gets the users that inherits a subject. domain is an unreferenced parameter here, may be used in other implementations.

func (rm *RoleManager) HasLink(name1 string, name2 string, domain ...string) bool

HasLink determines whether role: name1 inherits role: name2. domain is a prefix to the roles.

func (*RoleManager) PrintRoles

func (rm *RoleManager) PrintRoles()

PrintRoles prints all the roles to log.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL