---
title: "removeRight(_:completion:)"
framework: localauthentication
role: symbol
role_heading: Instance Method
path: "localauthentication/larightstore/removeright(_:completion:)"
---

# removeRight(_:completion:)

Removes a right from the right store given an instance of that right.

## Declaration

```swift
func removeRight(_ right: LAPersistedRight, completion handler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func removeRight(_ right: LAPersistedRight) async throws
```

## Parameters

- `right`: An instance that represents the right to remove.
- `handler`: A completion handler to call when the removal operation completes.

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func removeRight(_ right: LAPersistedRight) async throws For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. Removing a right also removes any resources stored along with the right, such as secrets.

## See Also

### Removing stored rights

- [removeRight(forIdentifier:completion:)](localauthentication/larightstore/removeright(foridentifier:completion:).md)
- [removeAllRights(completion:)](localauthentication/larightstore/removeallrights(completion:).md)
