# Sandbox.GameObject.NetworkAccessor.AssignOwnership

```csharp
bool AssignOwnership(Connection channel)
```

Set the owner of this object to the specified [Sandbox.Connection](/api/Sandbox.Connection).



Note: whether you can assign ownership of this object depends on the
[Sandbox.GameObject.NetworkAccessor.OwnerTransfer](/api/Sandbox.GameObject.NetworkAccessor/OwnerTransfer) of this networked object.

### Parameters

- `channel` (`Connection`)

### Returns

`bool`

### Exceptions

- `System.ArgumentNullException`: `channel` cannot be null. To clear owner, use [Sandbox.GameObject.NetworkAccessor.DropOwnership](/api/Sandbox.GameObject.NetworkAccessor/DropOwnership) instead.

Declared in [Sandbox.GameObject.NetworkAccessor](/api/Sandbox.GameObject.NetworkAccessor).
Assembly: `Sandbox.Engine`.
