Package ru.tehkode.permissions.exceptions

Examples of ru.tehkode.permissions.exceptions.RankingException


      targetGroup = entry.getValue();
    }

    if (targetGroup == null) {
      throw new RankingException("User are not promoteable", this, promoter);
    }

    this.swapGroups(sourceGroup, targetGroup);

    this.callEvent(PermissionEntityEvent.Action.RANK_CHANGED);
View Full Code Here


      targetGroup = entry.getValue();
    }

    if (targetGroup == null) {
      throw new RankingException("User are not demoteable", this, demoter);
    }

    this.swapGroups(sourceGroup, targetGroup);

    this.callEvent(PermissionEntityEvent.Action.RANK_CHANGED);
View Full Code Here

    return this.cachedPermissions.get(worldName);
  }

  protected int getPromoterRankAndCheck(PermissionUser promoter, String ladderName) throws RankingException {
    if (!this.isRanked(ladderName)) { // not ranked
      throw new RankingException("User are not in this ladder", this, promoter);
    }

    int rank = this.getRank(ladderName);
    int promoterRank = 0;

    if (promoter != null && promoter.isRanked(ladderName)) {
      promoterRank = promoter.getRank(ladderName);

      if (promoterRank >= rank) {
        throw new RankingException("Promoter don't have high enough rank to change " + this.getIdentifier() + "/" + getName() + "'s rank", this, promoter);
      }
    }

    return promoterRank;
  }
View Full Code Here

TOP

Related Classes of ru.tehkode.permissions.exceptions.RankingException

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.