EngineHub / WorldEdit

🗺️ Minecraft map editor and mod
https://enginehub.org/worldedit/
Other
3.1k stars 867 forks source link

Integrate with NeoForge permissions API #2029

Open octylFractal opened 2 years ago

octylFractal commented 2 years ago

The Problem

NeoForge version of WorldEdit has no permission integrations.

A Solution

NeoForge has a permissions API, we should integrate with it for use with future permission mods.

Alternatives

No response

Anything Else?

Dependent on https://github.com/LuckPerms/LuckPerms/issues/3936 for a working implementation.

MagnusHJensen commented 2 years ago

I don't see why it's dependent on the luckperms PR?

I got it to work with ftbranks, by just adding || PermissionsAPI.hasPermission(player, permission); In the ForgePermissionsProvider#VanillaPermissionsProvider

It also handles the isOp check, or atleast by default if no mods is replacing the PermissionsAPI it checks for the permission level.

me4502 commented 2 years ago

I don't see why it's dependent on the luckperms PR?

I got it to work with ftbranks, by just adding

|| PermissionsAPI.hasPermission(player, permission);

In the ForgePermissionsProvider#VanillaPermissionsProvider

It also handles the isOp check, or atleast by default if no mods is replacing the PermissionsAPI it checks for the permission level.

That was mostly referring to needing a working reputable perms mod in order to properly test the implementation, we hadn't been made aware that one existed and haven't had time to look into it. If you've got a working change to WorldEdit that implements this we'd definitely appreciate a PR.

MagnusHJensen commented 2 years ago

I would love for LuckPerms to arrive for forge.

Currently the only "major" player is FTBRanks. It has poor documentation and is no way as good/advanced as LuckPerms, but it does the job for now.

I do, I will create a PR here in a bit.

My original intention was for 1.16, but it should work the same for 1.18.

How would I go about that, make two seperate pr's? Is it even possible to get stuff merged into the archived 1.16 version?

MagnusHJensen commented 2 years ago

The PR #2079 would fix this integration for 1.16.5.

For 1.18 it would most likely require a working implementation either in the LuckPerms PR or for FTBRanks to re-integrate with the PermissionAPI.

me4502 commented 1 year ago

This is fairly infeasible with the new permissions API in Forge. It's created in a way that's fairly incompatible with the way WorldEdit handles permissions. It'd require extremely large restructuring and rethinking of permission nodes, which would be a breaking change

As there are no docs on the new Permissions API - it's also not really clear if any of those limitations can be worked around