Solved Children permission nodes

Discussion in 'Plugin Development' started by Chinwe, Jun 19, 2013.

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

    Chinwe

    Ello.

    I'm trying to add children nodes to my commands, so you can add permission.node.* to have all of the children nodes, though it's confusing me a bit :c

    I'm trying a permissions.yml for the first time: is this right?
    Code:
    gibby.gib:
        description: Allows use of the /gib command.
        default: op
       
    gibby.gibstick:
        description: Allows use of the /gibstick command.
        default: op
        children:
            gibby.gibstick.list: false
            gibby.gibstick.clearlist: false
    And then before the sub command, Im using:
    Code:
    if (!sender.hasPermission("gibby.gibstick.list"))
    {
        sender.sendMessage(ChatColor.RED + "You don't have permission to use that!");
        return true;
    }
    
    If this isn't right, how can I allow use of all the sub commands (ie. if args[0].equals("list")) through the node gibby.gibstick.* ?

    Thanks in advance :>
     
  2. Offline

    lycano

    It would be if you would have added gibby.gibstick.*: and not gibby.gibstick: ;)

    I believe you should checkout the Permission Configuration on bukkit wiki.
     
  3. Offline

    Chinwe

    Oh..daaamn, I managed to miss that part >:C
    Should have known it would be so simple :c

    Thanks anyway :3
     
  4. Offline

    bennie3211

    why do you have a permission.yml? You have to put them in the plugin.yml right?
     
  5. Offline

    Chinwe

    Oh yeh, I was trying it in there but I added it to plugin.yml now, forgot to say that :>
     
Thread Status:
Not open for further replies.

Share This Page