---
title: "grantCapability:error:"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/berenderingprocess/grantcapability:error:"
---

# grantCapability:error:

Grants the specified capability to the process.

## Declaration

```occ
- (id<BEProcessCapabilityGrant>) grantCapability:(BEProcessCapability *) capability error:(NSError **) error;
```

## Parameters

- `capability`: The capability to grant.
- `error`: If an error occurs, upon return contains an doc://com.apple.documentation/documentation/Foundation/NSError object that describes the problem. If you don’t want information about errors that happen, pass in NULL.

## Return Value

Return Value A BEProcessCapabilityGrant object that represents the granted capability, or nil if an error occurs.

## Discussion

Discussion When the process no longer needs the capability, call invalidate on the returned object.

## See Also

### Coordinating processes

- [grantCapability:error:invalidationHandler:](browserenginekit/berenderingprocess/grantcapability:error:invalidationhandler:.md)
- [createVisibilityPropagationInteraction](browserenginekit/berenderingprocess/createvisibilitypropagationinteraction.md)
