---
title: "hasAccess(to:in:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensioncontext/hasaccess(to:in:)"
---

# hasAccess(to:in:)

Checks the specified URL against the currently granted permission match patterns in a specific tab.

## Declaration

```swift
func hasAccess(to url: URL, in tab: (any WKWebExtensionTab)?) -> Bool
```

## Parameters

- `url`: The URL for which to return the status.
- `tab`: The tab in which to return the permission status, or nil if the tab is not known or the global status is desired.

## Discussion

Discussion Some match patterns can be granted on a per-tab basis. When the tab is known, access checks should always use this method.

## See Also

### Related Documentation

- [currentPermissionMatchPatterns](webkit/wkwebextensioncontext/currentpermissionmatchpatterns.md)
- [hasAccess(to:in:)](webkit/wkwebextensioncontext/hasaccess(to:in:).md)
- [permissionStatus(for:)](webkit/wkwebextensioncontext/permissionstatus(for:)-7ojrb.md)
- [permissionStatus(for:in:)](webkit/wkwebextensioncontext/permissionstatus(for:in:)-96xaf.md)
- [permissionStatus(for:)](webkit/wkwebextensioncontext/permissionstatus(for:)-7mu8.md)
- [permissionStatus(for:in:)](webkit/wkwebextensioncontext/permissionstatus(for:in:)-nqhm.md)
