Class User

java.lang.Object
io.github.coho04.mysql.entities.User
All Implemented Interfaces:
QueryHelper

public class User extends Object implements QueryHelper
Represents a User in the application.
  • Constructor Details

    • User

      public User(String name, MYSQL mysql)
      Represents a User in the application.
  • Method Details

    • getName

      public String getName()
      Retrieves the name of the user.
      Returns:
      The name of the user.
    • drop

      public void drop(boolean database)
      Drops the user from the database. If the database parameter is true, it also drops the corresponding database.
      Parameters:
      database - true if the database should also be dropped, false otherwise
    • setPermission

      public void setPermission(Permissions permissions)
      Sets the permissions for the user.
      Parameters:
      permissions - The permissions to be set for the user.
    • setPermissionToDatabase

      public void setPermissionToDatabase(Permissions permissions, Database database)
      Sets the specified permissions to the given database for the current user.
      Parameters:
      permissions - The permissions to be set for the database.
      database - The database for which the permissions are to be set.
    • removePermission

      public void removePermission(Permissions permissions)
      Removes the specified permissions from the user.
      Parameters:
      permissions - The permissions to be removed from the user.
    • removePermissionToDatabase

      public void removePermissionToDatabase(Permissions PERMISSION, Database database)
      Removes the specified permissions from the user for the given database.
      Parameters:
      PERMISSION - The permissions to be removed from the user.
      database - The database from which to remove the permissions.
    • setPassword

      public void setPassword(String password)
      Sets the password for the user.
      Parameters:
      password - The password to be set for the user.