---
title: "CFFileSecuritySetAccessControlList(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cffilesecuritysetaccesscontrollist(_:_:)"
---

# CFFileSecuritySetAccessControlList(_:_:)

Sets the access control list associated with a CFFileSecurityRef object.

## Declaration

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

## Parameters

- `fileSec`: The CFFileSecurityRef object to modify.
- `accessControlList`: 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

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

## Discussion

Discussion 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.

## See Also

### Functions

- [CFAllocatorAllocateBytes(_:_:_:)](corefoundation/cfallocatorallocatebytes(_:_:_:).md)
- [CFAllocatorAllocateTyped(_:_:_:_:)](corefoundation/cfallocatorallocatetyped(_:_:_:_:).md)
- [CFAllocatorReallocateBytes(_:_:_:_:)](corefoundation/cfallocatorreallocatebytes(_:_:_:_:).md)
- [CFAllocatorReallocateTyped(_:_:_:_:_:)](corefoundation/cfallocatorreallocatetyped(_:_:_:_:_:).md)
- [CFAttributedStringGetBidiLevelsAndResolvedDirections(_:_:_:_:_:)](corefoundation/cfattributedstringgetbidilevelsandresolveddirections(_:_:_:_:_:).md)
- [CFBundleCopyLocalizedStringForLocalizations(_:_:_:_:_:)](corefoundation/cfbundlecopylocalizedstringforlocalizations(_:_:_:_:_:).md)
- [CFBundleIsArchitectureLoadable(_:)](corefoundation/cfbundleisarchitectureloadable(_:).md)
- [CFBundleIsExecutableLoadable(_:)](corefoundation/cfbundleisexecutableloadable(_:).md)
- [CFBundleIsExecutableLoadableForURL(_:)](corefoundation/cfbundleisexecutableloadableforurl(_:).md)
- [CFCopyHomeDirectoryURL()](corefoundation/cfcopyhomedirectoryurl().md)
- [CFDateFormatterCreateISO8601Formatter(_:_:)](corefoundation/cfdateformattercreateiso8601formatter(_:_:).md)
- [CFFileSecurityClearProperties(_:_:)](corefoundation/cffilesecurityclearproperties(_:_:).md)
- [CFFileSecurityCopyAccessControlList(_:_:)](corefoundation/cffilesecuritycopyaccesscontrollist(_:_:).md)
- [CFFileSecurityCopyGroupUUID(_:_:)](corefoundation/cffilesecuritycopygroupuuid(_:_:).md)
- [CFFileSecurityCopyOwnerUUID(_:_:)](corefoundation/cffilesecuritycopyowneruuid(_:_:).md)
