winox

package
v0.0.0-...-c1efb88 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	PermissionChangeGrant = iota
	PermissionChangeRevoke
)
View Source
const (
	InheritanceModeNone = iota
	InheritanceModeFull
)
View Source
const (
	RightsRead    = syscallex.GENERIC_READ
	RightsWrite   = syscallex.GENERIC_WRITE
	RightsExecute = syscallex.GENERIC_EXECUTE
	RightsAll     = syscallex.GENERIC_ALL

	RightsFull = RightsRead | RightsWrite | RightsExecute | RightsAll
)

Variables

This section is empty.

Functions

func AddUser

func AddUser(username string, password string, comment string) error

func AsErrno

func AsErrno(err error) (syscall.Errno, bool)

func ForceSetPassword

func ForceSetPassword(username string, password string) error

func GetFolderPath

func GetFolderPath(folderType FolderType) (string, error)

func GetImpersonationToken

func GetImpersonationToken(username string, domain string, password string) (syscall.Token, error)

func Impersonate

func Impersonate(username string, domain string, password string, cb ImpersonateCallback) error

func LoadProfileOnce

func LoadProfileOnce(username string, domain string, password string) error

func Logon

func Logon(username string, domain string, password string) (syscall.Token, error)

func RemoveUserFromUsersGroup

func RemoveUserFromUsersGroup(username string) error

Remove "username" from the "Users" group if needed

func SafeRelease

func SafeRelease(handle uintptr)

func SetFilePermissions

func SetFilePermissions(params *SetFilePermissionsParams) error

func UserHasPermission

func UserHasPermission(impersonationToken syscall.Token, accessDesired uint32, path string) (bool, error)

func VerifyTrust

func VerifyTrust(path string) error

Types

type FolderType

type FolderType int
const (
	FolderTypeProfile FolderType = iota
	FolderTypeAppData
	FolderTypeLocalAppData
)

type ImpersonateCallback

type ImpersonateCallback func() error

type InheritanceMode

type InheritanceMode int

type PermissionChange

type PermissionChange int

type Rights

type Rights uint32

type SetFilePermissionsParams

type SetFilePermissionsParams struct {
	FilePath         string
	Trustee          string
	PermissionChange PermissionChange

	AccessRights Rights
	Inheritance  InheritanceMode
}

type ShareEntry

type ShareEntry struct {
	Path        string
	Inheritance InheritanceMode
	Rights      Rights
}

func (*ShareEntry) Grant

func (se *ShareEntry) Grant(trustee string) error

func (*ShareEntry) Revoke

func (se *ShareEntry) Revoke(trustee string) error

type SharingPolicy

type SharingPolicy struct {
	Trustee string
	Entries []*ShareEntry
}

func (*SharingPolicy) Grant

func (sp *SharingPolicy) Grant(consumer *state.Consumer) error

func (*SharingPolicy) Revoke

func (sp *SharingPolicy) Revoke(consumer *state.Consumer) error

func (*SharingPolicy) String

func (sp *SharingPolicy) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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