Documentation
¶
Overview ¶
Package acl grants and revokes NTFS permissions on a file or directory — a modern, icacls-backed take on the classic "shell out to cacls to fix a folder's rights" admin chore, which legacy scripts ran through an elevated helper.
Here the elevation story is separate: run the process elevated (or hand the command to runas) and call Grant/Revoke directly. The command assembly is pure and unit-tested; the execution is Windows-only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedPlatform = errors.New("winadmin/acl: only supported on Windows")
ErrUnsupportedPlatform is returned off Windows.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Recurse applies the change to the directory and everything under it
// (icacls /T).
Recurse bool
// NoInherit grants the right WITHOUT the (OI)(CI) object/container inherit
// flags. The default (false) makes a directory grant inheritable, which is
// what "give this group access to this folder" almost always means.
NoInherit bool
}
Options tunes how the change is applied.
type Permission ¶
type Permission string
Permission is an icacls simple-rights token.
const ( Read Permission = "R" // read ReadExecute Permission = "RX" // read & execute Modify Permission = "M" // modify (read/write/delete) Write Permission = "W" // write FullControl Permission = "F" // full control )
Click to show internal directories.
Click to hide internal directories.