How to properly add permissions?

Discussion in 'Plugin Development' started by bdubz4552, May 1, 2014.

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

    bdubz4552

    I looked at tutorials to figure out how to register permission nodes in plugin.yml and child nodes and all that worked, but a user of my plugin told me that permission nodes were not working for them. They use Essentials Group Manager. I saw PluginManager.addPermission() but do not know if this is necessary on top of registering via plugin.yml, nor does the JavaDoc for the method mention this. My uncertainty is also magnified by the fact that this is the first time someone has mentioned a permission bug, in the half year my plugin has been out. If someone could just clarify this for me, it would be much appreciated.
     
  2. Offline

    rsod

    You don't really required to register, you may just check them.
     
  3. Offline

    bdubz4552

    rsod
    So as long as they are stated in plugin.yml they should work for all permission plugins?
     
  4. Offline

    Trevor1134

    bdubz4552 I don't believe they need to be in the plugin.yml, I haven't needed to do so.
     
  5. Offline

    tacos1223

    Sorry if I misread this, but if you want to add permissions to your plugin, just use:
    Code:
    Player player = (Player) sender;
    if player.hasPermission("Your permission"){
    //stuff
     
  6. Offline

    bdubz4552

    :confused: So there is no need to define permission nodes anywhere? That doesn't seem right...

    I check nodes this way already, but when I was learning Bukkit plugin basics I was told I had to register permission nodes inside plugin.yml. Now it sounds like this isn't even a thing :confused:

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

    Trevor1134

  8. Offline

    tacos1223

    The only reason I use permissions inside the code is if you have more than 1 argument. Such as /heal (player).
     
Thread Status:
Not open for further replies.

Share This Page