plugin.yml Permissions overriding default permissions and PEX

Discussion in 'Plugin Development' started by RabidCrab, Sep 14, 2012.

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

    RabidCrab

    I'm wondering if this is default behavior, or if I'm doing something wrong.

    The issue is simple. If I set a permission in my permissions.yml, it refuses to read it. Instead it uses my plugins default permissions.

    I tried these scenarios:
    With PEX and Vault
    Without PEX, with Vault
    Without both PEX and Vault

    permissions.yml:
    Code:
    users:
        yetigt:
        permissions:
        vote.startvote.sun: false
    plugin.yml in my plugin:
    Code:
    permissions:
        vote.voteyes.*:
            description: Gives access to voting yes.
            usage: vote.voteyes.kick allows the player to vote yes on a kick vote. vote.voteyes.ban for ban, etc.
            default: true
            children:
                vote.voteyes.day: true
                vote.voteyes.night: true
                vote.voteyes.sun: true
                vote.voteyes.rain: true
                vote.voteyes.kick: true
                vote.voteyes.ban: true
                vote.voteyes.restart: true
        vote.voteno.*:
            description: Gives access to voting no.
            usage: vote.voteyes.kick allows the player to vote no on a kick vote. vote.voteyes.ban for ban, etc.
            default: true
            children:
                vote.voteno.day: true
                vote.voteno.night: true
                vote.voteno.sun: true
                vote.voteno.rain: true
                vote.voteno.kick: true
                vote.voteno.ban: true
                vote.voteno.restart: true
        vote.unbannable:
            description: Makes the user immune to ban votes.
            default: op
        vote.setvalue:
            description: This is used by the vote system to execute vote types that are specific to the plugin.
            default: op
        vote.unkickable:
            description: Makes the user immune to kick votes.
            default: op
        vote.startvote.*:
            description: Gives access to starting a vote type.
            usage: vote.startvote.kick allows the player to start a kick vote. vote.startvote.ban for ban, etc.
            default: true
            children:
                vote.startvote.day: true
                vote.startvote.night: true
                vote.startvote.sun: true
                vote.startvote.rain: true
                vote.startvote.kick: true
                vote.startvote.ban: true
                vote.startvote.restart: true
    Inside my plugin is how it deals with the player permissions:
    Code:
    public class MockPermissionHandler implements IPermissionHandler
    {
        /**
        * Default permissions are handled by Bukkit
        */
        public boolean has(Player player, String permission)
        {
            return player.hasPermission(permission);
        }
     
        /**
        * Default permissions are handled by Bukkit
        */
        public boolean has(CommandSender sender, String permission)
        {
            return sender.hasPermission(permission);
        }
    }
    And finally, the vote execution:
    [​IMG]
     
  2. Offline

    chaseoes

    My standard response:

    Found your problem! :D
     
  3. Offline

    RabidCrab

    Tried it with and without. Same problem for both.
     
Thread Status:
Not open for further replies.

Share This Page