Nodes (Permissions)

Discussion in 'Plugin Development' started by Zelnehlun, Mar 26, 2011.

  1. Offline

    Zelnehlun

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Hey,
    I am currently trying to do a Permissions support for my plugins. For the commands I used things like "if(cmd.getName().equalsIgnoreCase("setspawn")){". Now I read through the tutorial on how to use Permissions for my plugin. There it says something about these nodes and this "Some plugin authors use /command style for nodes, please do not do this.".
    I would appreciate your help on how I could make my plugins support Permissions:)
  2. Offline

    Edward Hand

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  3. Offline

    Zelnehlun

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    That was the page I found the stuff with the nodes on. My question is how I can create these nodes for the commands.
  4. Offline

    Crash

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    You don't actually create the node anywhere, you can just do :
    permissions.getHandler().permission(<player>, "node path");

    For example if you wanted to check for setspawn
    Code:
    if(permissions.getHandler().permission(player, "spawnplugin.setspawn")){
    
        // Has the node
    
    } else {
    
        // Doesn't have the node
    
    }
    Then if you want your player or group or whatever to have the node just add this after permissions:
    in the <world name>.yml file
    Code:
    - 'spawnplugin.setspawn'
    
  5. Offline

    Zelnehlun

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks for your help, I will take a look at it tomorrow :)

Share This Page