Solved * permission node.

Discussion in 'Spigot Plugin Development' started by Vylerion, Apr 30, 2017.

  1. Hey guys.

    I have a short question: how to add the * permission node usig the PermissionAttachement class of the player?
    I know you can add * but that doesnt work to us (we tried '*' as well).

    Thanks in advance!
  2. Correct me if I'm wrong, but isn't * an invention of PEX that several permission plugins adopted? I don't think it's a Bukkit thing.
  3. I looked into the source of pex and found nothing about the * node
  4. Anyone else that can help me?


    I found out it is a invention. Anyone knowing how i could do this myself?
  5. PEX overrides most of Bukkit's native permission system in order to do it. Bukkit doesn't support it natively. Actually, a * node is against the logic behind Bukkit's permission system, so I don't think that's surprising.
  6. It's called a wildcard, it's not an invention by the creator(s) pex, if you think that pex was the first piece of code to use such a thing, you are incorrect. Many regex flavours use wildcards. If you mean that it was added to Bukkit, then you are correct, Bukkit by default does not support permission node wildcards
  7. So how would i able to make such a 'wildcard'?
  8. You can loop through the string and when you find a wildcard character, keep going on until you find somewhere to continue, I, personally, think that if you find an implementation of some regex flavour, you could find how these wildcards are interpreted
  9. electronicboy

    IRC Staff

    quite simply, * isn't supported in any shape or form by bukkit, Permission plugins add that feature themselves by "hacking" away bukkits permission system and adding their own implementation that supports that, as Luck basically pointed out in that post
  10. I came to the conclusion i can use reflection and edit hasPermission as is done in the topic. Does anyone know what i need to edit specificly?

    oops wrong, i mean PermissibleBase.
  11. BUMP, i'm still at permissibleblase. I'm thinking to edit #hasPermission and check if the player has *. this would work wouldnt it
  12. electronicboy

    IRC Staff

    What exactly is your goal? is this going to be a public plugin that you're working on?
    What are you trying to accomplish?
    You can add children to a permission node, which would allow for a semi-wildcard effect.
  14. This is an plugin im working on for our network because we wanted a custom plugin. Everything works fine (setup with SQL syncing etc). But we can't figure out the * node. Should i just make my own PermissibleBase and edit #hasPermission?
  15. well. i kinda figured it out. I went on and made my own PermissibleBase kind of class and used reflection to edit the current one. But it gives me an error that it ca't edit a final variable..
  16. Still i can't understand for what you want the '*' permissions, if you want to make a permission to give access to all your plugin permissions like 'myplugin.*', you can simply add all the permissions as childs.
  17. Its handier and some plugins dont register their permission.
  18. So you're creating a Permission plugin ?
  19. Not only that, we're using it for our network because we are having a hard time setting up other plugins which for some reason dont work. Back on topic please :)