perms

package
v0.0.0-...-b178995 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(action ActionType, objectType ObjectType) string

Action formats an action `<action_type>:<object_type>`

func GetRole

func GetRole(k string) (rbac.Role, error)

func GetRoles

func GetRoles(keys []string) (rbac.Roles, error)

func Resource

func Resource(service ServiceName, objectType ObjectType) string

func ResourceWithID

func ResourceWithID(service ServiceName, objectType ObjectType, objectID string) string

func Setup

func Setup(conf *config.Config) error

func SetupRole

func SetupRole(r *config.Role) error

Types

type ActionType

type ActionType string
const (
	Read     ActionType = "read"
	Stat     ActionType = "stat"
	Delete   ActionType = "delete"
	Write    ActionType = "write"
	List     ActionType = "list"
	Snapshot ActionType = "snapshot"
	Search   ActionType = "search"
	GC       ActionType = "gc"
	Destroy  ActionType = "destroy"
	Admin    ActionType = "admin" // Catch-all action for admin/advanced feature
)

Actions

type ObjectType

type ObjectType string
const (
	Blob           ObjectType = "blob"
	KVEntry        ObjectType = "kv"
	FS             ObjectType = "fs"
	Node           ObjectType = "node"
	Namespace      ObjectType = "namespace"
	JSONDocument   ObjectType = "json-doc"
	JSONCollection ObjectType = "json-col"
)

Object types

type ServiceName

type ServiceName string
const (
	BlobStore ServiceName = "blobstore"
	KvStore   ServiceName = "kvstore"
	DocStore  ServiceName = "docstore"
	Filetree  ServiceName = "filetree"
	Stash     ServiceName = "stash"
)

Services

Jump to

Keyboard shortcuts

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