pgacl

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Privileges   Privileges
	GrantOptions Privileges
	Role         string
	GrantedBy    string
}

ACL represents a single PostgreSQL `aclitem` entry.

func Parse

func Parse(aclStr string) (ACL, error)

Parse parses a PostgreSQL aclitem string and returns an ACL

func (ACL) GetGrantOption

func (a ACL) GetGrantOption(priv Privileges) bool

GetGrantOption returns true if the acl has the grant option set for the specified priviledge.

func (ACL) GetPrivilege

func (a ACL) GetPrivilege(priv Privileges) bool

GetPriviledge returns true if the acl has the specified priviledge set.

func (ACL) String

func (a ACL) String() string

String produces a PostgreSQL aclitem-compatible string

type Privileges

type Privileges uint16

Privileges represents a PostgreSQL ACL bitmask

const (
	NoPrivs Privileges = 0

	// Ordering taken from postgresql/src/include/nodes/parsenodes.h
	Insert Privileges = 1 << iota
	Select
	Update
	Delete
	Truncate
	References
	Trigger
	Execute
	Usage
	Create
	Temporary
	Connect
	Set
	System
	Maintain
)

See postgresql/src/include/utils/acl.h for inspiration. Like PostgreSQL, "rights" refer to the combined grant option and privilege bits fields.

Jump to

Keyboard shortcuts

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