---
title: "checkAccess(to:requestedAccess:context:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsvolume/accesscheckhandler/checkaccess(to:requestedaccess:context:replyhandler:)"
---

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

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

## Declaration

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

```swift
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 doc://FSKit/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 doc://FSKit/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.

## See Also

### Checking access

- [FSVolume.AccessMask](fskit/fsvolume/accessmask.md)
- [FSCheckAccessResult](fskit/fscheckaccessresult.md)
