Sets the access control list associated with a CFFileSecurityRef object.


func CFFileSecuritySetAccessControlList(_ fileSec: CFFileSecurity!, _ accessControlList: acl_t!) -> Bool



The CFFileSecurityRef object to modify.


The access control list to set, or kCFFileSecurityRemoveACL to indicate that the access control list should be removed from a file, or NULL to unset the access control list property in the object.

Return Value

Returns true if the access control list was successfully set, or false otherwise.


To remove the access control list from a file system object, pass kCFFileSecurityRemoveACL as the accessControlList parameter. Then, call CFURLSetResourcePropertyForKey(_:_:_:_:) to set kCFURLFileSecurityKey to the resulting fileSec object.

Setting the accessControlList to NULL unsets the ACL property of the CFFileSecurityRef object. By doing this, the access control list of the file will be unchanged if you subsequently use this object to set permissions on an actual file system object.