Documentation ¶
Rendered for windows/amd64
Index ¶
- Constants
- func AddUser(username string, password string, comment string) error
- func AsErrno(err error) (syscall.Errno, bool)
- func GetFolderPath(folderType FolderType) (string, error)
- func GetImpersonationToken(username string, domain string, password string) (syscall.Handle, error)
- func Impersonate(username string, domain string, password string, cb ImpersonateCallback) error
- func LoadProfileOnce(username string, domain string, password string) error
- func Logon(username string, domain string, password string) (syscall.Handle, error)
- func RemoveUserFromUsersGroup(username string) error
- func SafeRelease(handle uintptr)
- func SetFilePermissions(params *SetFilePermissionsParams) error
- func UserHasPermission(impersonationToken syscall.Handle, accessDesired uint32, path string) (bool, error)
- type FolderType
- type ImpersonateCallback
- type InheritanceMode
- type PermissionChange
- type Rights
- type SetFilePermissionsParams
- type ShareEntry
- type SharingPolicy
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 GetFolderPath ¶
func GetFolderPath(folderType FolderType) (string, error)
func GetImpersonationToken ¶
func Impersonate ¶
func Impersonate(username string, domain string, password string, cb ImpersonateCallback) error
func RemoveUserFromUsersGroup ¶
Remove "username" from the "Users" group if needed
func SafeRelease ¶
func SafeRelease(handle uintptr)
func SetFilePermissions ¶
func SetFilePermissions(params *SetFilePermissionsParams) 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 SetFilePermissionsParams ¶
type SetFilePermissionsParams struct { FilePath string Trustee string PermissionChange PermissionChange AccessRights Rights Inheritance InheritanceMode }
type ShareEntry ¶
type ShareEntry struct {}
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) String ¶
func (sp *SharingPolicy) String() string
Click to show internal directories.
Click to hide internal directories.