# libtmux.Server.server_access

- **Module:** libtmux.Server
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/server.py#L843
- **Page:** https://libtmux.org/reference/py/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``.

Requires tmux 3.3+ (introduced in 3.3).

## Parameters

- `self`
- `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.

## Example

```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)
```
