mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-07 04:53:11 +00:00
Add PermissionsHandler for Vault.
We'll use the VaultAPI if it's there for group checks. This will also allow us to default to Player#hasPermission from Bukkit instead of going through each permission plugin.
This commit is contained in:
parent
7439dc01a5
commit
ac0858dcdb
3 changed files with 70 additions and 1 deletions
|
@ -97,6 +97,18 @@ public class PermissionsHandler implements IPermissionsHandler {
|
|||
public void checkPermissions() {
|
||||
final PluginManager pluginManager = ess.getServer().getPluginManager();
|
||||
|
||||
final Plugin vaultAPI = pluginManager.getPlugin("Vault");
|
||||
if (vaultAPI != null && vaultAPI.isEnabled()) {
|
||||
if (!(handler instanceof VaultHandler)) {
|
||||
VaultHandler vault = new VaultHandler(ess);
|
||||
if (vault.setupPermissions()) {
|
||||
LOGGER.log(Level.INFO, "Essentials: Using Vault based permissions.");
|
||||
handler = vault;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final Plugin permExPlugin = pluginManager.getPlugin("PermissionsEx");
|
||||
if (permExPlugin != null && permExPlugin.isEnabled()) {
|
||||
if (!(handler instanceof PermissionsExHandler)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue