> For the complete documentation index, see [llms.txt](https://docs.saturncms.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.saturncms.net/1.0.0/dev/libraries-and-functions/accountmanager/permissions.md).

# Permissions

Saturn has a built-in permissions system, it's designed to work with the Control Panel plugin, but will work for any other control-panel-esque as well.

### Check if the user has a certain permission.

```php
use Saturn\AccountManager\Permissions;

$Permissions = new Permissions($_SESSION['uuid']);
if ($Permissions->HasPermission(['administrator','panel_access'],'OR')) {
    // User is an administrator, or has the panel_access permission.
} else {
    // User is not an administrator.
    // They also don't have the panel_access permission.
}
```

### Fetch a list of the user's permissions.

```php
use Saturn\AccountManager\Permissions;

$Permissions = new Permissions($_SESSION['uuid']);

// All the user's permissions in JSON object format.
$UserPermissions = $Permissions->Permissions;
```
