gnembon / fabric-carpet

Fabric Carpet
MIT License
1.65k stars 261 forks source link

Support fabric permissions api for better customizing carpet commands #1850

Open Silverteal opened 6 months ago

Silverteal commented 6 months ago

Currently, carpet commands's usage limit is hard-encoded in carpet config, adding support to lucko/fabric-permissions-api will allow more accurate access control. This may be optional or disabled by default, but I do think it would be helpful to someone like me.

sakura-ryoko commented 6 months ago

Generally the "lucko fabric permissions API" supports vanilla op levels, without the need for LuckPerms, FYI. Depending on how carpet implement's it's command dispatcher (I haven't looked) it's generally a trivial addition. Perhaps I can consider a PR.

sakura-ryoko commented 6 months ago

The Permissions settings are pretty much coded based on Methods under the Carpet Settings, so changing to something like that is possible, but it would also break existing carpet config files if say, someone were to implement a setting of "ops" for the permissions. So, the permissions check functions need to basically be re-written, along with the config methods to make this work; and then come up with a "standard" method for the Luck Permissions nodes that all downstream dependent carpet mods will need to implement... So it's not quite that trivial on second thought.