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!
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.
Anyone else that can help me? Edit: I found out it is a invention. Anyone knowing how i could do this myself?
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.
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
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
I'm reading this: https://www.spigotmc.org/threads/wildcard-permission-using-permissionattachment.217139/. If i cant get out ill ask for help here.
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
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? Edit: oops wrong, i mean PermissibleBase.
BUMP, i'm still at permissibleblase. I'm thinking to edit #hasPermission and check if the player has *. this would work wouldnt it
http://xyproblem.info What are you trying to accomplish? You can add children to a permission node, which would allow for a semi-wildcard effect.
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?
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..
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.
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