# Permissions

### Permission Nodes

| Permission             | Description                    | Default |
| ---------------------- | ------------------------------ | ------- |
| `spawnelytra.admin`    | Access to admin commands       | OP      |
| `spawnelytra.use`      | Allows using elytra in spawn   | true    |
| `spawnelytra.useboost` | Allows using the boost feature | true    |

### Detailed Permission Information

#### spawnelytra.admin

Grants access to administrative commands.

**Commands Affected:**

* `/spawnelytra reload`
* `/spawnelytra visualize`
* `/spawnelytra settings`
* `/spawnelytra setup`
* `/spawnelytra dismiss`

**Default:** Operators only

#### spawnelytra.use

Allows players to activate and use the invisible elytra within the spawn area.

**Features Affected:**

* Double-jump activation
* Auto activation
* Sneak-jump activation
* F-key activation
* Basic flight capability

**Default:** All players

#### spawnelytra.useboost

Allows players to use the boost feature while gliding.

**Features Affected:**

* Pressing F key to boost
* All boost directions (forward and upward)

**Default:** All players

### Permission Setup Examples

#### Basic Setup (Default)

Most servers can use the default permissions:

```yaml
# Everyone can use elytra and boost
# Only OPs can use admin commands
# No changes needed
```

#### Restricted Access

For VIP-only elytra access:

```yaml
groups:
  default:
    permissions:
    - -spawnelytra.use
    - -spawnelytra.useboost
  
  vip:
    permissions:
    - spawnelytra.use
    - spawnelytra.useboost
```

#### Boost-Only Restriction

Allow everyone to fly, but only VIPs can boost:

```yaml
groups:
  default:
    permissions:
    - spawnelytra.use
    - -spawnelytra.useboost
  
  vip:
    permissions:
    - spawnelytra.use
    - spawnelytra.useboost
```

#### Staff Configuration

Full access for staff members:

```yaml
groups:
  staff:
    permissions:
    - spawnelytra.admin
    - spawnelytra.use
    - spawnelytra.useboost
```

### Integration with Permission Plugins

#### LuckPerms

```bash
# Grant use permission to a group
/lp group default permission set spawnelytra.use true

# Grant boost permission to VIP
/lp group vip permission set spawnelytra.useboost true

# Grant admin permission to staff
/lp group staff permission set spawnelytra.admin true
```

#### PermissionsEx

```bash
# Grant permissions
/pex group default add spawnelytra.use
/pex group vip add spawnelytra.useboost
/pex group admin add spawnelytra.admin
```

#### GroupManager

```bash
# Add permissions
/mangaddp default spawnelytra.use
/mangaddp vip spawnelytra.useboost
/mangaddp admin spawnelytra.admin
```

### Permission Checking

The plugin checks permissions at these points:

1. **On Activation Attempt**
   * Checks `spawnelytra.use` before allowing flight
2. **On Boost Attempt**
   * Checks `spawnelytra.useboost` when player presses F
3. **On Command Execution**
   * Checks `spawnelytra.admin` for admin commands

### Wildcard Permissions

Some permission plugins support wildcards:

```yaml
# Grant all spawnelytra permissions
spawnelytra.*
```

This grants all current and future permissions from the plugin.

### Permission Inheritance

Most permission plugins support inheritance:

```yaml
groups:
  player:
    permissions:
    - spawnelytra.use
  
  vip:
    inheritance:
    - player
    permissions:
    - spawnelytra.useboost
  
  admin:
    inheritance:
    - vip
    permissions:
    - spawnelytra.admin
```

### Troubleshooting Permissions

#### Common Issues

1. **Players can't use elytra**
   * Check if they have `spawnelytra.use`
   * Verify they're in the spawn area
   * Make sure creative mode restriction isn't blocking them (check `game_modes.disable_in_creative` in config)
2. **Boost not working**
   * Check `spawnelytra.useboost` permission
   * Confirm they're already gliding
   * Check if boost is enabled in config
3. **Commands not working**
   * Verify `spawnelytra.admin` permission
   * Check for typos in permission nodes
   * Ensure permission plugin is working

#### Debug Commands

Test permissions with your permission plugin:

```bash
# LuckPerms
/lp user <player> permission check spawnelytra.use

# PermissionsEx
/pex user <player> check spawnelytra.use
```

### See Also

* [Commands](https://blaxk.gitbook.io/spawnelytra/commands) - Commands affected by permissions
* [Configuration](https://blaxk.gitbook.io/spawnelytra/configuration) - Plugin configuration options
* [Getting Started](https://blaxk.gitbook.io/spawnelytra/readme) - Basic usage guide
