Essentially, I want to be able to control permissions from a MySQL database instead of permissions in the server files. The only reasonable way I see of doing this is to make my own command classes, such as BanCommand, and have them check if the user has permission, and if so, then run the vanilla version of the command. Is there a way of doing this? Or is there something in sponge that allows me to check permissions somewhere else? I’m clearly lost and could use some assistance/advice. Thank you!
When you create a command it automatically overrides the vanilla one if it conflicts with the one you made. So you could create a string from the requested data from SQL and set that as the permission. You dont have to worry about doing anything about manually overriding it when the command is run.
Awesome, but does that mean I have to personally implement the actions of the vanilla command if I decide they have permission? This actually looks totally do-able, it would just save time if there was a way to say “yes they have permission, now run it like it was a vanilla command call”.
Yes you do have to manually put the functionality in your new command.
wait a minute, what server files are you using to set up permissions? ive been trying to use PEX, would love ANY alternative
Okay, thanks for your help @intronate67!
I don’t understand what you’re asking @PixelStudios. I’m currently using pex if that’s what you’re asking
@PixelStudios hes not trying to setup his user permissions for a server, hes creating a plugin where instead of storing his permissions Strings of permissions in a file or variable he wants them in a SQL database instead which might be essentially safer but i don’t know why you’d want to hide your permissions
& what problems are you having with Pex?
Not for safety or hiding permissions, just for easier implementation with other features I plan to add to my server. And I actually really like pex, it just makes more sense for me to store them in a database with the rest of my data
AFAIK PEX has an option to store perms as SQL but i haven’t looked into it yet
It’s not implemented yet for Sponge. Was for Bukkit.
The right way would be to write your own permission plugin. You basically have to provide an implementation for the PermissionService interface.