<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/AccessCheckHandler/checkAccess(to:requestedAccess:context:replyHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeAccessCheckHandler(im)checkAccessToItem:requestedAccess:context:replyHandler:"
  },
  "title" : "checkAccess(to:requestedAccess:context:replyHandler:)"
}
-->

# checkAccess(to:requestedAccess:context:replyHandler:)

Checks whether the file system allows access to the given item.

```
func checkAccess(to theItem: FSItem, requestedAccess access: FSVolume.AccessMask, context: FSContext, replyHandler reply: @escaping @Sendable (FSCheckAccessResult?, (any Error)?) -> Void)
```

```
func checkAccess(to theItem: FSItem, requestedAccess access: FSVolume.AccessMask, context: FSContext) async throws -> FSCheckAccessResult
```

## Parameters

`theItem`

The item for which to check access.

`access`

A mask indicating a set of access types for which to check.

`context`

An object that enables context-aware file system decisions throughout the operation.

`reply`

A block or closure to indicate success or failure. If the access check succeeds, pass an instance of [`FSCheckAccessResult`](/documentation/FSKit/FSCheckAccessResult) containing a Boolean value to indicate whether the file system grants access, along with a `nil` error. If the access check fails, pass the relevant error as the second parameter; FSKit ignores the [`FSCheckAccessResult`](/documentation/FSKit/FSCheckAccessResult) instance in this case. For an `async` Swift implementation, there’s no reply handler; simply return the result instance or throw an error.

---

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)