roles

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AVAILABLE_ROLES map[string][]string

Functions

func AddPermissionsToRole

func AddPermissionsToRole(roleName string, permissions []string) error

Useful to add roles to the default Locksmith Admin role not many other uses..

func AddRole

func AddRole(role Role)

func GetPermissionsForRole

func GetPermissionsForRole(roleName string) ([]string, error)

func RoleExists

func RoleExists(roleName string) bool

Types

type Role

type Role struct {
	Name        string   `json:"name" bson:"name"`
	Permissions []string `json:"permissions" bson:"permissions"`
}

func GetRole

func GetRole(roleName string) (Role, error)

func (Role) HasPermission

func (r Role) HasPermission(permission string) bool

Jump to

Keyboard shortcuts

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