---
title: "scope(_:)"
framework: Assignables
role: symbol
role_heading: Instance Method
platforms: [iOS 17.4+, iPadOS 17.4+, Mac Catalyst 17.4+]
path: "assignables/useridentity/scope(_:)-esta"
---

# scope(_:)

Sets the user identity for document-related operations that occur within the closure passed in.

## Declaration

```swift
@discardableResult func scope<R>(_ access: () throws -> R) rethrows -> R
```

## Parameters

- `access`: A closure containing document-related operations . Operations in the closure will be attributed to this user identity.

## Return Value

Return Value The result of the closure.

## See Also

### Setting the scope

- [scope(_:)](assignables/useridentity/scope(_:)-j2jq.md)
