acl

package
v0.0.0-...-884d9dc Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateIDs

func CalculateIDs(idString string) (int64, error)

CalculateIDs Calculate hex from User selector (#0, @0, *, %0)

func ParseResources

func ParseResources(resources string) (string, error)

ParseResources Converts a resources string to a hex. number (e.g. NET+VROUTER/@190)

func ParseRights

func ParseRights(rights string) (string, error)

ParseRights Converts a rights string to a hex. number (MANAGE+ADMIN)

func ParseUsers

func ParseUsers(users string) (string, error)

ParseUsers Converts a string in the form [#<id>, @<id>, *] to a hex. number

func ParseZone

func ParseZone(zone string) (string, error)

ParseZone Convert a zone part of the ACL String (#0)

Types

type ACL

type ACL struct {
	XMLName  xml.Name `xml:"ACL"`
	ID       int      `xml:"ID,omitempty"`
	User     string   `xml:"USER,omitempty"`
	Resource string   `xml:"RESOURCE,omitempty"`
	Rights   string   `xml:"RIGHTS,omitempty"`
	Zone     string   `xml:"ZONE,omitempty"`
	String   string   `xml:"STRING,omitempty"`
}

ACL represents an OpenNebula ACL

type Pool

type Pool struct {
	XMLName xml.Name `xml:"ACL_POOL"`
	ACLs    []ACL    `xml:"ACL"`
}

Pool represents an OpenNebula ACL pool

type Resources

type Resources uint64
const (
	VM             Resources = 0x1000000000
	Host           Resources = 0x2000000000
	Net            Resources = 0x4000000000
	Image          Resources = 0x8000000000
	User           Resources = 0x10000000000
	Template       Resources = 0x20000000000
	Group          Resources = 0x40000000000
	Datastore      Resources = 0x100000000000
	Cluster        Resources = 0x200000000000
	Document       Resources = 0x400000000000
	Zone           Resources = 0x800000000000
	SecGroup       Resources = 0x1000000000000
	Vdc            Resources = 0x2000000000000
	VRouter        Resources = 0x4000000000000
	MarketPlace    Resources = 0x8000000000000
	MarketPlaceApp Resources = 0x10000000000000
	VMGroup        Resources = 0x20000000000000
	VNTemplate     Resources = 0x40000000000000
)

type Rights

type Rights uint64
const (
	Use    Rights = 0x1 // Auth. to use an object
	Manage Rights = 0x2 // Auth. to perform management actions
	Admin  Rights = 0x4 // Auth. to perform administrative actions
	Create Rights = 0x8 // Auth. to create an object
)

type Users

type Users uint64
const (
	UID        Users = 0x100000000
	GID        Users = 0x200000000
	All        Users = 0x400000000
	ClusterUsr Users = 0x800000000
)

Jump to

Keyboard shortcuts

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