Question about permissions.

Discussion in 'Plugin Development' started by afistofirony, Jun 14, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    afistofirony

    Hello all! I am relatively new to making plugins, I just started yesterday :p

    Let's say I want to have a general permission and a set of fine-tuned permissions.

    Let's say I put the following:
    Code:
            if(commandLabel.equalsIgnoreCase("pw")){
                if(player instanceof Player)
                if(player.hasPermission("postwall.seeinfo"))
                if(player.hasPermission("postwall.general"))
    Does this mean that a player has to have both permissions for the command, or does it mean that either permission will work?

    Explanation: If a player has postwall.seeinfo, but not postwall.general, will the command work? Or does a player need both permissions to be granted access to the command?
     
  2. Offline

    CorrieKay

    if you wanted to check if they have one of a few permissions, try this

    if(player.hasPermission("postwall.seeinfo")||player.hasPermission("postwall.general")){
    //code
    }

    if you wanted to check if they had BOTH, replace || with &&
     
    afistofirony likes this.
  3. Offline

    afistofirony

    Ah, thanks! :D
     
Thread Status:
Not open for further replies.

Share This Page