<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFFileSecuritySetAccessControlList(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFFileSecuritySetAccessControlList"
  },
  "title" : "CFFileSecuritySetAccessControlList(_:_:)"
}
-->

# CFFileSecuritySetAccessControlList(_:_:)

Sets the access control list associated with a `CFFileSecurityRef` object.

```
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

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

## Discussion

To remove the access control list from a file system object, pass `kCFFileSecurityRemoveACL` as the `accessControlList` parameter. Then, call [`CFURLSetResourcePropertyForKey(_:_:_:_:)`](/documentation/CoreFoundation/CFURLSetResourcePropertyForKey(_:_:_:_:)) to set [`kCFURLFileSecurityKey`](/documentation/CoreFoundation/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)