auth

package
v0.0.0-...-09aa624 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Groups = map[string][]string{
	"admin": {
		"atm",
		"datm",
		"wm",
	},
	"training": {
		"ta",
		"ins",
		"mtr",
	},
	"events": {
		"ec",
		"events",
	},
	"web": {
		"wm",
		"web",
	},
	"files": {
		"atm",
		"datm",
		"wm",
		"ta",
		"ec",
		"fe",
	},
}
View Source
var Roles = map[string]Role{
	"atm": {
		Name: "atm",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"datm": {
		Name: "datm",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"ta": {
		Name: "ta",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"ec": {
		Name: "ec",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"fe": {
		Name: "fe",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"wm": {
		Name: "wm",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"ins": {
		Name: "ins",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"ta",
			"wm",
		},
	},
	"mtr": {
		Name: "mtr",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"ta",
			"wm",
		},
	},
	"events": {
		Name: "events",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"ec",
			"wm",
		},
	},
	"web": {
		Name: "web",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"k8s-cluster-admin": {
		Name: "k8s-cluster-admin",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"k8s-cluster-webteam": {
		Name: "k8s-cluster-webteam",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"k8s-cluster-mysql": {
		Name: "k8s-cluster-mysql",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
	"k8s-cluster-mysql-write": {
		Name: "k8s-cluster-mysql-write",
		RolesCanAdd: []string{
			"atm",
			"datm",
			"wm",
		},
	},
}

Functions

func CanUserModifyRole

func CanUserModifyRole(user *dbTypes.User, role string) bool

func HasRole

func HasRole(user *dbTypes.User, role string) bool

func HasRoleList

func HasRoleList(user *dbTypes.User, roles []string) bool

func InGroup

func InGroup(user *dbTypes.User, group string) bool

Types

type Role

type Role struct {
	Name        string
	RolesCanAdd []string
}

Jump to

Keyboard shortcuts

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