Explanation of the TreeSecInfoAction options when setting permissions using File
3 min
out of the box, activate uses the fileutilities https //activate activatelive com/activate/api/html/t innovation activate utilities fileutilities htm setdirectoryaclex method to set permissions when applying security to ntfs folders setdirectoryaclex( path , accesscontrollist, action ) when setdirectoryaclex is run against a target folder that has existing permissions defined the accesscontrollist parameter defines what happens to existing permissions defined directly on the target folder e g prefixing with “ all;” overwrites any existing permissions and blocks inheritance no prefix “adds” the specific permissions to the folder acl and does not block inheritance the optional action parameter defines the changes that activate will make to sub folders that have permissions explicitly defined or inheritance disabled the action parameter is a treesecinfoaction enumeration, the values for which are member name value description action set 1 an enum constant representing the set option adds new permissions to folders reset 2 an enum constant representing the reset option overwrites existing permissions resetkeepexplicit 3 an enum constant representing the reset keep explicit option a combination of the previous two existing aces are not removed inheritance is not re enabled existing aces are removed inheritance is re enabled existing aces are not removed inheritance is re enabled example when setdirectoryaclex is used against the folder structure folder name description additional ace has a permission defined explicitly on the folder to grant a group access no inheritance has inheritance blocked and a new set of permissions defined same as test1 only permissions inherited from test1 apply the results of the treesecinfoaction options are sets permissions on the folder supplied in path without altering existing aces on sub folders the default if action is not specified additional ace; the permission granting access to the group remains set no inheritance; no change, i e inheritance is blocked and a new set of permissions defined same as test1; no change, i e only permissions inherited from test1 apply sets permissions on the folder supplied in path and resets all permissions on sub folders, including re enabling inheritance additional ace; the permission granting access to the group is removed and only permissions inherited from test1 apply no inheritance; inheritance is re enabled and only permissions inherited from test1 apply same as test1; no change, i e only permissions inherited from test1 apply sets permissions on the folder supplied in path , re enables inheritance on sub folders, does not remove existing aces from sub folders additional ace; the permission granting access to the group remains set no inheritance; inheritance is re enabled and only permissions inherited from test1 apply same as test1; no change, i e only permissions inherited from test1 apply