Class PermissionValidate

java.lang.Object
com.github.mafelp.utils.PermissionValidate

public class PermissionValidate
extends java.lang.Object
The class that checks if a user is authorised in the configuration.
  • Constructor Summary

    Constructors
    Constructor Description
    PermissionValidate()  
  • Method Summary

    Modifier and Type Method Description
    static boolean authorised​(org.javacord.api.entity.server.Server server, org.javacord.api.entity.message.MessageAuthor user)
    Checks if a message author is bot owner or server admin or is authorised in the configuration file (Configuration.getServerConfiguration(Server)).
    static boolean serverPermission​(org.javacord.api.entity.server.Server server, org.javacord.api.entity.user.User user)
    Checks if the given user's id is authorised in the server's configuration file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PermissionValidate

      public PermissionValidate()
  • Method Details

    • authorised

      public static boolean authorised​(org.javacord.api.entity.server.Server server, org.javacord.api.entity.message.MessageAuthor user)
      Checks if a message author is bot owner or server admin or is authorised in the configuration file (Configuration.getServerConfiguration(Server)).
      Parameters:
      server - The server to check the permission on.
      user - The MessageAuthor to check th permissions of.
      Returns:
      If the user has the requested permissions.
    • serverPermission

      public static boolean serverPermission​(org.javacord.api.entity.server.Server server, org.javacord.api.entity.user.User user)
      Checks if the given user's id is authorised in the server's configuration file.
      Parameters:
      server - The server on which to check the configuration.
      user - The user to check the permission of.
      Returns:
      If the user is authorised.