Class PermissionsChecker

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean has​(Sender sender, java.lang.String perm, boolean msg)
      Checks if a user (no console) has a specific permission (globally).
      boolean hasOnServer​(Sender sender, java.lang.String perm, boolean msg)
      Checks if a user (no console) has a specific permission on the current server.
      boolean hasOnServerInWorld​(Sender sender, java.lang.String perm, boolean msg)
      Checks if a user (no console) has a specific permission on the current server and in the current world.
      boolean hasOrConsole​(Sender sender, java.lang.String perm, boolean msg)
      Checks if a user (or console) has a specific permission (globally).
      boolean hasOrConsoleOnServer​(Sender sender, java.lang.String perm, boolean msg)
      Checks if a user (or console) has a specific permission on the current server.
      boolean hasOrConsoleOnServerInWorld​(Sender sender, java.lang.String perm, boolean msg)
      Checks if a user (or console) has a specific permission on the current server and in the current world.
      boolean hasPerm​(java.lang.String sender, java.lang.String permission)
      Checks if a user (no console) has a specific permission (globally).
      boolean hasPerm​(Sender sender, java.lang.String permission)
      Checks if a user (no console) has a specific permission (globally).
      boolean hasPermOnServer​(java.lang.String sender, java.lang.String permission, java.lang.String server)
      Checks if a user (no console) has a specific permission on the given server.
      boolean hasPermOnServer​(Sender sender, java.lang.String permission)
      Checks if a user (no console) has a specific permission.
      boolean hasPermOnServerInWorld​(java.lang.String sender, java.lang.String permission, java.lang.String server, java.lang.String world)
      Checks if a user (no console) has a specific permission on the given server and in the given world.
      boolean hasPermOnServerInWorld​(Sender sender, java.lang.String permission)
      Checks if a user (no console) has a specific permission.
      boolean hasPermOrConsole​(Sender sender, java.lang.String permission)
      Checks if a user (or console) has a specific permission (globally).
      boolean hasPermOrConsoleOnServer​(Sender sender, java.lang.String permission)
      Checks if a user (or console) has a specific permission.
      boolean hasPermOrConsoleOnServerInWorld​(Sender sender, java.lang.String permission)
      Checks if a user (or console) has a specific permission.
      protected PermissionsManager pm()  
      • Methods inherited from class java.lang.Object

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

      • PermissionsChecker

        public PermissionsChecker()
    • Method Detail

      • hasPerm

        public boolean hasPerm​(java.lang.String sender,
                               java.lang.String permission)
        Checks if a user (no console) has a specific permission (globally).
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        Returns:
        the result of the permission check
      • hasPermOnServer

        public boolean hasPermOnServer​(java.lang.String sender,
                                       java.lang.String permission,
                                       java.lang.String server)
        Checks if a user (no console) has a specific permission on the given server.
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        server - the server for additional permissions
        Returns:
        the result of the permission check
      • hasPermOnServerInWorld

        public boolean hasPermOnServerInWorld​(java.lang.String sender,
                                              java.lang.String permission,
                                              java.lang.String server,
                                              java.lang.String world)
        Checks if a user (no console) has a specific permission on the given server and in the given world.
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        server - the server for additional permissions
        world - the world for additional permissions
        Returns:
        the result of the permission check
      • hasPerm

        public boolean hasPerm​(Sender sender,
                               java.lang.String permission)
        Checks if a user (no console) has a specific permission (globally).
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        Returns:
        the result of the permission check
      • hasPermOrConsole

        public boolean hasPermOrConsole​(Sender sender,
                                        java.lang.String permission)
        Checks if a user (or console) has a specific permission (globally). If sender is console this function return true.
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        Returns:
        the result of the permission check
      • hasPermOnServer

        public boolean hasPermOnServer​(Sender sender,
                                       java.lang.String permission)
        Checks if a user (no console) has a specific permission. Server is fetched automatically.
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        Returns:
        the result of the permission check
      • hasPermOrConsoleOnServer

        public boolean hasPermOrConsoleOnServer​(Sender sender,
                                                java.lang.String permission)
        Checks if a user (or console) has a specific permission. Server is fetched automatically.
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        Returns:
        the result of the permission check
      • hasPermOnServerInWorld

        public boolean hasPermOnServerInWorld​(Sender sender,
                                              java.lang.String permission)
        Checks if a user (no console) has a specific permission. Server and world are fetched automatically.
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        Returns:
        the result of the permission check
      • hasPermOrConsoleOnServerInWorld

        public boolean hasPermOrConsoleOnServerInWorld​(Sender sender,
                                                       java.lang.String permission)
        Checks if a user (or console) has a specific permission. Server and world are fetched automatically.
        Parameters:
        sender - the command sender to check a permission for
        permission - the permission to check
        Returns:
        the result of the permission check
      • has

        public boolean has​(Sender sender,
                           java.lang.String perm,
                           boolean msg)
        Checks if a user (no console) has a specific permission (globally).
        Parameters:
        sender - the command sender to check a permission for
        perm - the permission to check
        msg - if a no-permission message is send to the sender
        Returns:
        the result of the permission check
      • hasOrConsole

        public boolean hasOrConsole​(Sender sender,
                                    java.lang.String perm,
                                    boolean msg)
        Checks if a user (or console) has a specific permission (globally).
        Parameters:
        sender - the command sender to check a permission for
        perm - the permission to check
        msg - if a no-permission message is send to the sender
        Returns:
        the result of the permission check
      • hasOnServer

        public boolean hasOnServer​(Sender sender,
                                   java.lang.String perm,
                                   boolean msg)
        Checks if a user (no console) has a specific permission on the current server.
        Parameters:
        sender - the command sender to check a permission for
        perm - the permission to check
        msg - if a no-permission message is send to the sender
        Returns:
        the result of the permission check
      • hasOrConsoleOnServer

        public boolean hasOrConsoleOnServer​(Sender sender,
                                            java.lang.String perm,
                                            boolean msg)
        Checks if a user (or console) has a specific permission on the current server.
        Parameters:
        sender - the command sender to check a permission for
        perm - the permission to check
        msg - if a no-permission message is send to the sender
        Returns:
        the result of the permission check
      • hasOnServerInWorld

        public boolean hasOnServerInWorld​(Sender sender,
                                          java.lang.String perm,
                                          boolean msg)
        Checks if a user (no console) has a specific permission on the current server and in the current world.
        Parameters:
        sender - the command sender to check a permission for
        perm - the permission to check
        msg - if a no-permission message is send to the sender
        Returns:
        the result of the permission check
      • hasOrConsoleOnServerInWorld

        public boolean hasOrConsoleOnServerInWorld​(Sender sender,
                                                   java.lang.String perm,
                                                   boolean msg)
        Checks if a user (or console) has a specific permission on the current server and in the current world.
        Parameters:
        sender - the command sender to check a permission for
        perm - the permission to check
        msg - if a no-permission message is send to the sender
        Returns:
        the result of the permission check