---
title: "setPermissionStatus(_:for:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensioncontext/setpermissionstatus(_:for:)-5xahd"
---

# setPermissionStatus(_:for:)

Sets the permission status of a URL with a distant future expiration date.

## Declaration

```swift
func setPermissionStatus(_ status: WKWebExtensionContext.PermissionStatus, for url: URL)
```

## Parameters

- `status`: The new permission status to set for the given URL.
- `url`: The URL for which to set the status.

## Discussion

Discussion The URL is converted into a match pattern and will update grantedPermissionMatchPatterns and deniedPermissionMatchPatterns. Use this method for changing a single URL’s status. 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:expirationDate:)](webkit/wkwebextensioncontext/setpermissionstatus(_:for:expirationdate:)-5q9id.md)
