# 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

**Description:** Grants access to administrative commands

**Commands Affected:**

* `/spawnelytra reload`

**Default:** Operators only

**Usage Example:**

```yaml
permissions:
  spawnelytra.admin:
    description: Allows access to admin commands
    default: op
```

#### spawnelytra.use

**Description:** Allows players to activate and use the invisible elytra

**Features Affected:**

* Double-jump activation
* Automatic activation
* Basic flight capability

**Default:** All players

**Usage Example:**

```yaml
permissions:
  spawnelytra.use:
    description: Allows players to use the elytra boost feature
    default: true
```

#### spawnelytra.useboost

**Description:** Allows players to use the boost feature while flying

**Features Affected:**

* Pressing F key to boost
* All boost modes (forward, upward, combined)

**Default:** All players

**Usage Example:**

```yaml
permissions:
  spawnelytra.useboost:
    description: Allows players to use the boost feature
    default: true
```

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

#### 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 reload command

### Wildcard Permissions

Some permission plugins support wildcards:

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

**Note:** 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
   * Ensure they're not in creative mode
2. **Boost not working**
   * Check `spawnelytra.useboost` permission
   * Confirm they're already flying
   * Check if boost is on cooldown
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

# Vault (generic)
/permissions player <player> has spawnelytra.use
```

### Best Practices

1. **Start Simple**: Use default permissions initially
2. **Test Thoroughly**: Check permissions with test accounts
3. **Document Changes**: Keep track of custom permission setups
4. **Use Groups**: Manage permissions through groups, not individual players
5. **Regular Reviews**: Periodically review permission configurations

### 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/getting-started) - Basic usage guide
