# libtmux.Server.server_access

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/server.py#L840
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-server-server_access/

```
libtmux.Server.server_access(
    self,
    allow: str | None = None,
    deny: str | None = None,
    list_access: bool | None = None,
    read_only: bool | None = None,
    write: bool | None = None,
) -> list[str] | None
```

Manage server access control via [`$ tmux server-access`](/en/tmux/latest/manual/server-access/).

Requires tmux 3.3+ (introduced in 3.3).

## Examples

```python
>>> from libtmux.common import has_gte_version
>>> if has_gte_version("3.3"):
...     result = server.server_access(list_access=True)
...     assert isinstance(result, list)
```

## Parameters

- `allow` (`str | None`): Allow a user (``-a`` flag).
- `deny` (`str | None`): Deny a user (``-d`` flag).
- `list_access` (`bool | None`): List access rules (``-l`` flag).
- `read_only` (`bool | None`): Force the user to attach read-only (``-r`` flag). Implies
allow if the user is not already in the ACL. Mutually
exclusive with *write* — tmux rejects ``-r -w``.
- `write` (`bool | None`): Allow the user to attach read-write (``-w`` flag). Implies
allow if the user is not already in the ACL. Mutually
exclusive with *read_only*.

## Returns

list[str] | None
    Access list when *list_access* is True, None otherwise.
