Command Permissions
Gate’s permission system allows you to control who can execute commands and access features.Permission Interface
Thepermission.Subject interface is implemented by command sources:
pkg/util/permission/permission.go
Basic Permission Checks
In Command Requirements
Add permission checks when registering commands:pkg/command/command.go:70-78
In Command Execution
Check permissions during command execution:Permission Levels
Organize permissions hierarchically:Built-in Command Permissions
Gate’s built-in commands use these permissions:| Command | Permission | Configurable |
|---|---|---|
/server | gate.command.server | Yes |
/glist | gate.command.glist | Yes |
/send | gate.command.send | Yes |
Enable permission checks for built-in commands with:in config.yml
Permission Checks for Players
Check permissions on player objects:Console vs Players
Different sources have different permission behavior:Implementing Permission Providers
Gate doesn’t include a permission management system by default. Implement your own:Simple File-based Permissions
Integrating with Players
Wrap player objects to add permission checking:External Permission Plugins
Integrate with permission plugins on backend servers:LuckPerms Integration
Query LuckPerms via plugin messages:Dynamic Permissions
Grant temporary permissions:Best Practices
Permission Naming
Permission Naming
Use a consistent naming scheme:
plugin.category.actionformat- All lowercase with dots as separators
- Specific to general:
gate.admin.kicknotkick.admin.gate
myplugin.command.teleportmyplugin.admin.reloadmyplugin.feature.fly
Wildcard Permissions
Wildcard Permissions
Support wildcard permissions for convenience:
myplugin.*- All plugin permissionsmyplugin.admin.*- All admin permissions*- All permissions (superadmin)
Default Permissions
Default Permissions
Some permissions should be granted by default:
Console Permissions
Console Permissions
Always grant console full permissions:
Next Steps
Command Examples
See complete command with permissions
Event System
Learn about Gate’s event system

