LuckPerms

LuckPerms

41.4k Downloads

Permissions for subcommands

Mansarde opened this issue ยท 5 comments

commented

Is it currently possible to set permissions for subcommands that don't each have their own node?
For example:

Command Effect
/weather set rain sets the weather
/weather get prints information about the weather

Now, some mods would define a node for each subcommand:
somemod.command.weather.set
somemod.command.weather.get

But some mods only define a node for the parent command:
somemod.command.weather

Is it possible to allow e.g. /weather get but not /weather set even when there is only one node?
Might this be possible to implement in principle, or is it not worth the hassle?

commented

Regardless of who's job it is, from the fact that this was closed after your answer I assume it's either impossible then or simply not worth the hassle.
Ah well, at least the uncertainty is gone. Was just curious is all. :)

commented

It's impossible to make it work reliably. You have to know that permission checks have to be put into the code manually. You'd have to intercept the command and evaluate it and construct a permission from it which would be riddled with corner cases etc.

In short the plugin itself has to add these fine grained checks. The permission plugin can do nothing about it

commented

Sorry, I was under the impression the reply above answered your question, so closed the ticket. :)

But basically, as has been said already, it's down to the individual plugins on the server to run and use their own permission checks.

The permissions plugin, (LuckPerms in this case) just replies to the lookup queries. It doesn't implement any checks itself.

commented

That is the job of the plugins, not the permission plugins.

commented

Thanks for the more detailed explanation! :)