IObjectSecurity Method: GrantAccessPermissions

Trustee As String,
AccessPermissions As String


[in] String Trustee
User or group name to whom access permissions are to be granted.

[in] String AccessPermissions
Access permissions to be granted to the Trustee. See Access Permissions for a complete list of access permissions that can be granted.

Grants (gives) the specified access permissions to the given Trustee. Note that this function differs from SetAccessPermissions. GrantAccessPermissions does not remove existing permissions that the Trustee might have.

GrantAccessPermissions does not accept deny permissions like -RX or -F. Use SetAccessPermissions or RevokeAccessPermissions to set deny permissions for the Trustee.


Dim ObjSec  As IObjectSecurity
Dim strFilePath  As String
strFilePath = "d:\test.txt"
Set ObjSec = CreateObject("DirectScript.ObjectSecurity")
ObjSec.AttachFile strFilePath
'Give TrusteeName read and execute permissions on the file.
ObjSec.GrantAccessPermissions "TrusteeName", "RX"


See Also