1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

I'm pretty sure I selected all files

This commit is contained in:
Tim203
2022-02-06 02:11:07 +01:00
parent 039b398dad
commit 4e60f9a1ed
3 changed files with 63 additions and 18 deletions

View File

@@ -0,0 +1,59 @@
/*
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Floodgate
*/
package org.geysermc.floodgate.command.util;
import static org.geysermc.floodgate.command.util.PermissionDefault.OP;
import static org.geysermc.floodgate.command.util.PermissionDefault.TRUE;
public enum Permission {
COMMAND_MAIN("floodgate.command.floodgate", TRUE),
COMMAND_MAIN_FIREWALL(COMMAND_MAIN, "firewall", OP),
COMMAND_LINK("floodgate.command.linkaccount", TRUE),
COMMAND_UNLINK("floodgate.command.unlinkaccount", TRUE),
COMMAND_WHITELIST("floodgate.command.fwhitelist", OP),
NEWS_RECEIVE("floodgate.news.receive", OP);
private final String permission;
private final PermissionDefault defaultValue;
Permission(String permission, PermissionDefault defaultValue) {
this.permission = permission;
this.defaultValue = defaultValue;
}
Permission(Permission parent, String child, PermissionDefault defaultValue) {
this(parent.get() + "." + child, defaultValue);
}
public String get() {
return permission;
}
public PermissionDefault defaultValue() {
return defaultValue;
}
}

View File

@@ -23,23 +23,8 @@
* @link https://github.com/GeyserMC/Floodgate
*/
package org.geysermc.floodgate.util;
package org.geysermc.floodgate.command.util;
public enum Permissions {
COMMAND_MAIN("floodgate.command.floodgate"),
COMMAND_LINK("floodgate.command.linkaccount"),
COMMAND_UNLINK("floodgate.command.unlinkaccount"),
COMMAND_WHITELIST("floodgate.command.fwhitelist"),
NEWS_RECEIVE("floodgate.news.receive");
private final String permission;
Permissions(String permission) {
this.permission = permission;
}
public String get() {
return permission;
}
public enum PermissionDefault {
TRUE, FALSE, OP, NOT_OP
}