[AB-xxx] adding default permissions for commands

adding owner limitation for certain internal commands
This commit is contained in:
Sheldan
2025-02-15 15:33:56 +01:00
parent 210140b242
commit f99c5351e6
99 changed files with 516 additions and 184 deletions

View File

@@ -5,6 +5,7 @@ import dev.sheldan.abstracto.core.command.condition.CommandCondition;
import dev.sheldan.abstracto.core.command.config.*;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.interaction.InteractionService;
@@ -138,6 +139,7 @@ public class Ban extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MODERATION)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName(BAN_COMMAND)
.build();

View File

@@ -6,6 +6,7 @@ import dev.sheldan.abstracto.core.command.config.validator.MinIntegerValueValida
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.interaction.InteractionService;
@@ -77,6 +78,7 @@ public class DeleteNote extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.USER_NOTES)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("delete")
.build();

View File

@@ -6,6 +6,7 @@ import dev.sheldan.abstracto.core.command.config.validator.MinIntegerValueValida
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.interaction.InteractionService;
@@ -76,6 +77,7 @@ public class DeleteWarning extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.WARNINGS)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("delete")
.build();

View File

@@ -8,6 +8,7 @@ import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.interaction.InteractionService;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.moderation.config.ModerationModuleDefinition;
import dev.sheldan.abstracto.moderation.config.ModerationSlashCommandNames;
@@ -71,6 +72,7 @@ public class EditInfraction extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.INFRACTIONS)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("edit")
.build();

View File

@@ -10,6 +10,7 @@ import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
import dev.sheldan.abstracto.core.interaction.InteractionService;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.models.database.AServer;
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
@@ -182,6 +183,7 @@ public class Infractions extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.INFRACTIONS)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("list")
.build();

View File

@@ -11,6 +11,7 @@ import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
import dev.sheldan.abstracto.core.interaction.InteractionService;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.templating.service.TemplateService;
import dev.sheldan.abstracto.moderation.config.ModerationModuleDefinition;
@@ -100,6 +101,7 @@ public class Kick extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MODERATION)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName(KICK_COMMAND)
.build();

View File

@@ -6,6 +6,7 @@ import dev.sheldan.abstracto.core.command.config.*;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -168,6 +169,7 @@ public class Mute extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MUTE)
.defaultPrivilege(SlashCommandPrivilegeLevels.INVITER)
.commandName("create")
.build();

View File

@@ -7,6 +7,7 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -155,6 +156,7 @@ public class Mutes extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MUTE)
.defaultPrivilege(SlashCommandPrivilegeLevels.INVITER)
.commandName("list")
.build();

View File

@@ -6,6 +6,7 @@ import dev.sheldan.abstracto.core.command.config.validator.MinIntegerValueValida
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -104,6 +105,7 @@ public class Purge extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MODERATION)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName(PURGE_COMMAND)
.build();

View File

@@ -7,6 +7,7 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -123,6 +124,7 @@ public class SlowMode extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MODERATION)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName(SLOWMODE_COMMAND)
.build();

View File

@@ -8,6 +8,7 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.interaction.InteractionService;
@@ -83,6 +84,7 @@ public class UnBan extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MODERATION)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName(UN_BAN_COMMAND)
.build();

View File

@@ -7,6 +7,7 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -86,6 +87,7 @@ public class UnMute extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.MUTE)
.defaultPrivilege(SlashCommandPrivilegeLevels.INVITER)
.commandName("remove")
.build();

View File

@@ -7,6 +7,7 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -97,6 +98,7 @@ public class UserNoteCommand extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.USER_NOTES)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("create")
.build();

View File

@@ -7,6 +7,7 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -148,6 +149,7 @@ public class UserNotes extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.USER_NOTES)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("list")
.build();

View File

@@ -6,6 +6,7 @@ import dev.sheldan.abstracto.core.command.config.*;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -123,6 +124,7 @@ public class Warn extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.WARNINGS)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("create")
.build();

View File

@@ -7,6 +7,7 @@ import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.exception.EntityGuildMismatchException;
@@ -160,6 +161,7 @@ public class Warnings extends AbstractConditionableCommand {
.builder()
.enabled(true)
.rootCommandName(ModerationSlashCommandNames.WARNINGS)
.defaultPrivilege(SlashCommandPrivilegeLevels.ADMIN)
.commandName("list")
.build();