Nodes (Permissions)

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

  1. Offline

    Zelnehlun

    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

  3. Offline

    Zelnehlun

    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

    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 (Text):
    1.  
    2. if(permissions.getHandler().permission(player, "spawnplugin.setspawn")){
    3.  
    4.     // Has the node
    5.  
    6. } else {
    7.  
    8.     // Doesn't have the node
    9.  
    10. }
    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 (Text):
    1.  
    2. - 'spawnplugin.setspawn'
    3.  
     
  5. Offline

    Zelnehlun

    Thanks for your help, I will take a look at it tomorrow :)
     

Share This Page