permissionutil

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 5 Imported by: 26

README

permissionutils

The package contains various helpers about permissions/privileges

Documentation

Index

Constants

View Source
const (

	// User Read Write Execute Permission
	UserRead             = os_read << os_user_shift
	UserWrite            = os_write << os_user_shift
	UserExecute          = os_ex << os_user_shift
	UserReadWrite        = UserRead | UserWrite
	UserReadWriteExecute = UserReadWrite | UserExecute

	// Group Read Write Execute Permission
	GroupRead             = os_read << os_group_shift
	GroupWrite            = os_write << os_group_shift
	GroupExecute          = os_ex << os_group_shift
	GroupReadWrite        = GroupRead | GroupWrite
	GroupReadWriteExecute = GroupReadWrite | GroupExecute

	// Other Read Write Execute Permission
	OtherRead             = os_read << os_other_shift
	OtherWrite            = os_write << os_other_shift
	OtherExecute          = os_ex << os_other_shift
	OtherReadWrite        = OtherRead | OtherWrite
	OtherReadWriteExecute = OtherReadWrite | OtherExecute

	// All Read Write Execute Permission
	AllRead             = UserRead | GroupRead | OtherRead
	AllWrite            = UserWrite | GroupWrite | OtherWrite
	AllExecute          = UserExecute | GroupExecute | OtherExecute
	AllReadWrite        = AllRead | AllWrite
	AllReadWriteExecute = AllReadWrite | AllExecute

	// Default File/Folder Permissions
	ConfigFolderPermission = UserReadWriteExecute
	ConfigFilePermission   = UserReadWrite
	BinaryPermission       = UserRead | UserExecute
	TempFilePermission     = UserReadWrite
)

Variables

View Source
var (
	IsRoot       bool
	HasCapNetRaw bool
)
View Source
var ErrNotImplemented = errors.New("not implemented")

Functions

func UpdateFilePerm added in v0.0.38

func UpdateFilePerm(filename string, perm int) error

UpdateFilePerm modifies the permissions of the given file. Returns an error if the file permissions could not be updated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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