🆕 New enumerations for usage mode and permissions

Took 37 seconds
This commit is contained in:
Kiran Hart 2023-10-27 10:24:40 -04:00
parent 50580f3e3d
commit 75d4fde8b5
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,51 @@
/*
* Auction House
* Copyright 2023 Kiran Hart
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package ca.tweetzy.auctionhouse.api;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NonNull;
@AllArgsConstructor
public enum AuctionHousePermission {
COMMAND_SELL(cmd("sell"), "Allows the user to use /ah sell"),
COMMAND_SEARCH(cmd("search"), "Allows the user to use /ah search <keywords>"),
COMMAND_ACTIVE(cmd("active"), "Allows the user to use /ah active"),
COMMAND_EXPIRED(cmd("expired"), "Allows the user to use /ah expired"),
COMMAND_PROFILE(cmd("profile"), "Allows the user to use /ah profile"),
COMMAND_ADMIN(cmd("admin"), "Allows the user to use /ah admin"),
COMMAND_RELOAD(cmd("reload"), "Allows the user to use /ah reload"),
UNLIMITED_LISTINGS(wild("auctionhouse.maxallowedlistings"), "Allows the user to have unlimited listings");
@Getter
private final String permission;
@Getter
private final String description;
private static String cmd(@NonNull final String value) {
return String.format("auctionhouse.command.%s", value);
}
private static String wild(@NonNull final String value) {
return String.format("%s.*", value);
}
}

View File

@ -0,0 +1,26 @@
/*
* Auction House
* Copyright 2023 Kiran Hart
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package ca.tweetzy.auctionhouse.api;
public enum AuctionUsageMode {
BIN_ONLY,
AUCTION_ONLY,
BIN_AND_AUCTION
}