Fixing my permissions file

Discussion in 'Spigot Plugin Development' started by MimoBot, Jun 30, 2016.

  1. So my plugin is now working and I am adding simple permissions, I am doing so by adding them to the plugin.yml file within my plugin. They work but kind of strangely.
    Code (yml (Unknown Language)):

    main: game.minecraft.playerfinder.PlayerFinder
    version: 1.3
    name: PlayerFinder


    commands:
        pf:
            description: Base command

    permissions:
        pf.find:
            default: not_op
        pf.howclose:
            default: not_op
        pf.deletepoint:
            default: not_op
        pf.setpoint:
            default: not_op
        pf.getpoint:
            default: not_op
     
    Obviously in this one version the commands should usable by everyone, which they are except if you're OP. I thought that if it was set to not_op it would include everyone including OP. Now in this one I have them set all to op:
    Code (yml (Unknown Language)):
     
    main: game.minecraft.playerfinder.PlayerFinder
    version: 1.3
    name: PlayerFinder


    commands:
        pf:
            description: Base command

    permissions:
        pf.find:
            default: op
        pf.howclose:
            default: op
        pf.deletepoint:
            default: op
        pf.setpoint:
            default: op
        pf.getpoint:
            default: op
     
    This version works as expected and I have made an error message appear for non-OP players when attempting the commands.

    So, how come is it that when I have them set to not_op they include everyone BUT op? And how do I make it so that when they are set to everyone, they set to truly everyone?
     
  2. I believe the permission default is 'not op', without the underscore.

    Code (Text):
    If node does not exist the permission defaults to op
    allowed defaults are: true, false, op, not op
    op default will be true if player is op
    no op default is the opposite behavior (of op)
    Taken from http://wiki.bukkit.org/Plugin_YAML
     
  3. Choco

    Moderator

    To set it to everyone, set the default to "true"