Package net.bnubot.core.commands

Examples of net.bnubot.core.commands.InsufficientAccessException


      if(commanderAccount != null)
        commanderAccess = commanderAccount.getAccess();

      int requiredAccess = rsCommand.getAccess();
      if(commanderAccess < requiredAccess)
        throw new InsufficientAccessException("(" + commanderAccess + "/" + requiredAccess + ")", commanderAccess > 0);
    }

    CommandRunnable cr = Profile.getCommand(command);
    if(cr == null) {
      source.dispatchRecieveError("Command " + command + " has no associated runnable");
View Full Code Here


    if(targetRank == null)
      throw new CommandFailedWithDetailsException("Invalid rank: " + targetAccess);

    if(!superUser) {
      if(subjectAccount.equals(commanderAccount))
        throw new InsufficientAccessException("to modify your self", true);

      int commanderAccess = 0;
      if(commanderAccount != null)
        commanderAccess = commanderAccount.getAccess();
      // TODO: get addMax from the database
      int addMax = commanderAccess - 1;
      if(targetAccess > addMax)
        throw new InsufficientAccessException("to add users beyond " + addMax, true);
      if(originalAccess >= commanderAccess)
        throw new InsufficientAccessException("to add users ranked above " + (commanderAccess - 1), true);
    }

    subjectAccount.setRank(targetRank);
    subjectAccount.setLastRankChange(new Date(System.currentTimeMillis()));
    try {
View Full Code Here

TOP

Related Classes of net.bnubot.core.commands.InsufficientAccessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.