---
title: "setPermissionStatus(_:for:expirationDate:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensioncontext/setpermissionstatus(_:for:expirationdate:)-692ui"
---

# setPermissionStatus(_:for:expirationDate:)

Sets the status of a permission with a specific expiration date.

## Declaration

```swift
func setPermissionStatus(_ status: WKWebExtensionContext.PermissionStatus, for permission: WKWebExtension.Permission, expirationDate: Date?)
```

## Parameters

- `status`: The new permission status to set for the given permission.
- `permission`: The permission for which to set the status.
- `expirationDate`: The expiration date for the new permission status, or \c nil for distant future.

## Discussion

Discussion This method will update grantedPermissions and deniedPermissions. Use this method for changing a single permission’s status. Passing a nil expiration date will be treated as a distant future date. Only WKWebExtensionContext.PermissionStatus.deniedExplicitly, WKWebExtensionContext.PermissionStatus.unknown, and WKWebExtensionContext.PermissionStatus.grantedExplicitly states are allowed to be set using this method.

## See Also

### Related Documentation

- [setPermissionStatus(_:for:)](webkit/wkwebextensioncontext/setpermissionstatus(_:for:)-4u95f.md)
