Ace
Immutable view of a native Windows access-control entry.
An entry can also be written as an AceSpec
wherever one is accepted.
Constructor
Ace :mask …
Constructs an access-allowed, access-denied, or system-audit entry.
Exactly one of allow, deny, or audit names the trustee. The
constructor is strict; use ace to build an entry
from declarative values such as SID strings and symbolic flags.
Parameters
| Name | Type | Description |
|---|---|---|
:allow? |
Sid |
Trustee of an access-allowed entry. |
:deny? |
Sid |
Trustee of an access-denied entry. |
:audit? |
Sid |
Trustee of a system-audit entry. |
:mask |
AccessMask |
Access mask. |
:flags? |
AceFlags |
ACE header flags, other than the audit outcomes. |
:object_type? |
uuid.Guid |
Object type, making this an object entry. |
:inherited_object_type? |
uuid.Guid |
Inherited object type, making this an object entry. |
:callback? |
Bool |
Build a callback entry. |
:application_data? |
Bin |
Trailing application data, zero-padded to 32-bit alignment. |
:successful? |
Bool |
Audit successful access. |
:failed? |
Bool |
Audit failed access. |
Errors
ValueError if zero or several trustees are given, if an audit entry has
no outcome, or if successful or failed is given for an allow or deny
entry.
Example
Fields
application_data @ BinThe exact bytes after the SID, which may be empty.
Raises
FieldErrorwhen the entry body is not interpreted.container_inherit @ BoolWhether container child objects inherit this entry.
critical @ BoolWhether the critical flag is set.
failed_access @ BoolWhether an audit or alarm entry selects failed access.
Raises
FieldErrorfor other entry types.flags @ AceFlagsThe ACE header flags.
inherit_only @ BoolWhether this entry applies only through inheritance.
inherited @ BoolWhether this entry was inherited.
inherited_object_type @ (uuid.Guid | nil)The inherited object type, or
nilwhen its object flag is clear.Raises
FieldErrorfor a non-object entry.mask @ AccessMaskThe access mask.
Raises
FieldErrorfor an entry layout without a mask.no_propagate_inherit @ BoolWhether inherited copies stop propagating after one generation.
object_flags @ IntNative object entry flags.
Raises
FieldErrorfor a non-object entry.object_inherit @ BoolWhether non-container child objects inherit this entry.
object_type @ (uuid.Guid | nil)The object type, or
nilwhen its object flag is clear.Raises
FieldErrorfor a non-object entry.sid @ SidThe trustee.
Raises
FieldErrorfor an entry layout without a SID.size @ IntDeclared entry packet size.
successful_access @ BoolWhether an audit or alarm entry selects successful access.
Raises
FieldErrorfor other entry types.trust_protected_filter @ BoolWhether an access-filter entry has the trust-protected flag.
Raises
FieldErrorfor other entry types.type @ AceTypeThe entry type.
type_code @ IntThe native numeric entry type code.
Methods
to_bin() -> Bin
Returns the exact native entry packet, including application or unknown data.