Permission nodes

Discussion in 'Plugin Development' started by iPoke111, Feb 21, 2014.

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

    iPoke111

    Hi,
    I'm trying to run a permissions check for a couple of nodes. They are dkitpvp.kit.archer and dkitpvp.kit.pvp. This works when I have either of those specific permissions. However, it does not work if I have dkitpvp.kit.* (it shows up red) - I have set it up in the plugin.yml. I will post my relevant code and YAML here:
    Code:java
    1. @Override
    2. public boolean onCommand(CommandSender s, Command cmd, String label,
    3. String[] args) {
    4. StringBuilder str = new StringBuilder();
    5. str.append(ChatColor.GOLD + "Kits: ");
    6. if(s.hasPermission("dkitpvp.kits.pvp"))
    7. str.append(ChatColor.GREEN + "PvP, ");
    8. else
    9. str.append(ChatColor.RED + "PvP, ");
    10. if(s.hasPermission("dkitpvp.kits.archer"))
    11. str.append(ChatColor.GREEN + "Archer");
    12. else
    13. str.append(ChatColor.RED + "Archer");
    14. s.sendMessage(str.toString());
    15. return true;
    16. }

    Code:
    permissions:
        dkitpvp.*:
            description: gives access to all DKitPvP commands
            default: false
            children:
                dkitpvp.alert: true
                dkitpvp.block.*: true
                dkitpvp.cc: true
                dkitpvp.kit.*: true
                dkitpvp.kits: true
                dkitpvp.rl: true
                dkitpvp.say: true
                dkitpvp.setstats: true
                dkitpvp.sethp: true
                dkitpvp.spawn.*: true
                dkitpvp.switchinv: true
                dkitpvp.tag.*: true
    #stuff 
        dkitpvp.kit.*:
            description: gives access to all kits
            default: false
            children:
                dkitpvp.kit.archer: true
                dkitpvp.kit.pvp: true
        dkitpvp.kit.archer:
            description: gives access to the archer kit
            default: true
        dkitpvp.kit.pvp:
            description: gives access to the pvp kit
            default: true
    Any help would be appreciated.
    Thanks,
    ~iPoke111

    mornin bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  2. Offline

    Konkz

    Please post your plugin.yml
     
  3. Offline

    iPoke111

    Konkz
    i did? all that matters anyway
    i'll post more anyway
    Code:
    name: DKitPvP
    main: me.Decelvice.OfficialKitPvP.Main
    version: 1.0
    description: >
                KitPvP fun!
    commands:
        alert:
            description: alerts a player
            usage: /<command> [player]
            permission: dkitpvp.alert
            permission-message: Unknown command. Type "/help" for help.
        archer:
            description: gives you the archer kit
            usage: /<command>
            permission: dkitpvp.kit.archer
            permission-message: Unknown command. Type "/help" for help.
        cc:
            description: clears the chat
            usage: /<command> [player]
            permission: dkitpvp.cc
            permission-message: Unknown command. Type "/help" for help.
            aliases: [clearchat]
        dkitrl:
            description: Reloads DKitPvP
            usage: /<command>
            permission: dkitpvp.rl
            permission-message: Unknown command. Type "/help" for help.
        kits:
            description: Lists kits
            usage: /<command>
            permission: dkitpvp.kits
            permission-message: Unknown command. Type "/help" for help.
        pvp:
            description: gives you the PvP kit
            usage: /<command>
            permission: dkitpvp.kit.pvp
            permission-message: Unknown command. Type "/help" for help.
        refresh:
            description: refreshes your tag
            usage: /<command>
            permission: dkitpvp.tag.refresh
            permission-message: Unknown command. Type "/help" for help.
        say:
            description: Server say command
            usage: /<command> <message...>
            permission: dkitpvp.say
            permission-message: Unknown command. Type "/help" for help.
            aliases: []
        set:
            description: Sets stats of a player
            usage: /<command> <k|kills> <amount> [player]
            permission: dkitpvp.setstats
            permission-message: Unknown command. Type "/help" for help.
        sethp:
            description: Sets hp of a player
            usage: /<command> <amount> [player]
            permission: dkitpvp.sethp
            permission-message: Unknown command. Type "/help" for help.
            aliases: [sethealth]
        spawn:
            description: spawns you
            usage: /<command>
            permissions: dkitpvp.spawn
            permission-message: Unknown command. Type "/help" for help.
        switchinv:
            description: Switches inventories
            usage: /<command>
            permission: dkitpvp.switchinv
            permission-message: Unknown command. Type "/help" for help.
            aliases: [sinv]
    permissions:
        dkitpvp.*:
            description: gives access to all DKitPvP commands
            default: false
            children:
                dkitpvp.alert: true
                dkitpvp.block.*: true
                dkitpvp.cc: true
                dkitpvp.kit.*: true
                dkitpvp.kits: true
                dkitpvp.rl: true
                dkitpvp.say: true
                dkitpvp.setstats: true
                dkitpvp.sethp: true
                dkitpvp.spawn.*: true
                dkitpvp.switchinv: true
                dkitpvp.tag.*: true
        dkitpvp.block.*:
            description: gives access to place and break blocks
            default: false
            children:
                dkitpvp.block.break: true
                dkitpvp.block.place: true
        dkitpvp.kit.*:
            description: gives access to all kits
            default: false
            children:
                dkitpvp.kit.archer: true
                dkitpvp.kit.pvp: true
        dkitpvp.kit.archer:
            description: gives access to the archer kit
            default: true
        dkitpvp.kit.pvp:
            description: gives access to the pvp kit
            default: true
        dkitpvp.tag.*:
            description: gives access to all tags
            default: false
            children:
                dkitpvp.tag.admin: true
                dkitpvp.tag.adminplus: true
                dkitpvp.tag.mod: true
                dkitpvp.tag.modplus: true
                dkitpvp.tag.refresh: true
        dkitpvp.spawn.*:
            description: gives full access to spawn command
            default: false
            children:
                dkitpvp.spawn: true
                dkitpvp.spawn.canbypass: true
                dkitpvp.spawn.others: true
                dkitpvp.spawn.exempt: true
        dkitpvp.spawn:
            description: allows you to spawn
            default: true
    .-.
     
  4. with what permissions plugin are you testing it?
     
  5. Offline

    iPoke111

    GroupManager from Essentials.

    ferrybig (forgot to tag)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  6. can you try with at least 2 other permissions plugins, sometimes I see this kind of small mistakes to be caused by some mistakes with the permission plugins giving the permission to player
     
  7. Offline

    iPoke111

    ferrybig
    Ok then.

    ferrybig
    Nope. I tested it with PermissionsEX and bPermissions and neither of them will make it work.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  8. Offline

    iPoke111

  9. Are you using Notepad++, and the permission color is red?
     
  10. Offline

    iPoke111

    DanyBv
    Sorry for my late reply. Yes, I am, but the permission colour is not red: the YAML is correct.
     
  11. Offline

    iPoke111

    Le bump.
     
Thread Status:
Not open for further replies.

Share This Page