Skip to content

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

NameTypeDescription
: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

let entry = Ace
  allow: (Sid :EVERYONE:)
  mask: (AccessMask :GENERIC_READ:)

Fields

application_data @ Bin

The exact bytes after the SID, which may be empty.

Raises FieldError when the entry body is not interpreted.

container_inherit @ Bool

Whether container child objects inherit this entry.

critical @ Bool

Whether the critical flag is set.

failed_access @ Bool

Whether an audit or alarm entry selects failed access.

Raises FieldError for other entry types.

flags @ AceFlags

The ACE header flags.

inherit_only @ Bool

Whether this entry applies only through inheritance.

inherited @ Bool

Whether this entry was inherited.

inherited_object_type @ (uuid.Guid | nil)

The inherited object type, or nil when its object flag is clear.

Raises FieldError for a non-object entry.

mask @ AccessMask

The access mask.

Raises FieldError for an entry layout without a mask.

no_propagate_inherit @ Bool

Whether inherited copies stop propagating after one generation.

object_flags @ Int

Native object entry flags.

Raises FieldError for a non-object entry.

object_inherit @ Bool

Whether non-container child objects inherit this entry.

object_type @ (uuid.Guid | nil)

The object type, or nil when its object flag is clear.

Raises FieldError for a non-object entry.

sid @ Sid

The trustee.

Raises FieldError for an entry layout without a SID.

size @ Int

Declared entry packet size.

successful_access @ Bool

Whether an audit or alarm entry selects successful access.

Raises FieldError for other entry types.

trust_protected_filter @ Bool

Whether an access-filter entry has the trust-protected flag.

Raises FieldError for other entry types.

type @ AceType

The entry type.

type_code @ Int

The native numeric entry type code.

Methods

to_bin() -> Bin

Returns the exact native entry packet, including application or unknown data.