WorldEdit icon indicating copy to clipboard operation
WorldEdit copied to clipboard

Integrate with NeoForge permissions API

Open octylFractal opened this issue 3 years ago • 5 comments

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.

octylFractal avatar Feb 03 '22 20:02 octylFractal

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.

MagnusHJensen avatar Apr 11 '22 08:04 MagnusHJensen

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.

me4502 avatar Apr 11 '22 08:04 me4502

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 avatar Apr 11 '22 08:04 MagnusHJensen

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.

MagnusHJensen avatar Apr 11 '22 11:04 MagnusHJensen

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

me4502 avatar Dec 31 '22 09:12 me4502