IAccessEntry Property: AccessFlags

Property Name
AccessFlags

Property Type
Byte

Description
Decides the inheritance behavior of the access permissions for a Security ACE. For an Audit ACE, it determines whether the ACE is for auditing success or failure.

The AccessFlags value can be a combination of the following:

Value

Meaning

0x00

The ACE applies only to the current objects

OBJECT_INHERIT_ACE = 0x01 

The ACE is inherited by non-container objects such as files created within the container object to which the ACE is assigned

CONTAINER_INHERIT_ACE = 0x02

The ACE is inherited by container objects such as directories

NO_PROPAGATE_INHERIT_ACE = 0x04  

The OBJECT_INHERIT_ACE and CONTAINER_INHERIT_ACE bits are not propagated to an inherited ACE

INHERIT_ONLY_ACE = 0x08 

The ACE does not apply to the object, but to the objects contained by it

SUCCESSFUL_ACCESS_ACE_FLAG = 0x40

Used with system-audit ACEs to indicate that a message is generated for successful access attempts

FAILED_ACCESS_ACE_FLAG = 0x80

Used with system-audit ACEs to indicate that a message is generated for failed access attempts

Example

Dim ObjSec As IObjectSecurity
Dim ACL As IAccessList
Dim ACE As IAccessEntry
Dim AuditSec As IAuditSecurity
Set ObjSec = CreateObject("DirectScript.ObjectSecurity")
'Get the Security Permissions for the file c:\test.txt
ObjSec.AttachFile "c:\test.txt"
Set ACL = ObjSec.GetAccessList
For Each ACE In ACL
Debug.Print ACE.AccessFlags
Next
'Get the Audit Permissions for the file c:\test.txt
Set AuditSec = ObjSec
Set ACL = AuditSec.GetAccessList
'Change all ACEs to audit success (40 in hex) and failure (80 in hex)
For Each ACE In ACL
ACE.AccessFlags = &H40 Or &H80
Next

 

See Also