🔑 PermissionsEx v2.0 [API 5]

Nope, was OP before I installed this and the server owner. Not allowed. :l

mfw Pixelmon dev replies to me on Sponge

Sponge assigns most commands to a permission – with upcoming changes everything checked with canCommandSenderUseCommand will be passed through, so that’ll get whatever is not handled already.

When PEX is installed, any commands will ignore op status in favor of PEX’s permission default (/pex group <group> def true for example). Op is used as a fallback when no permissions plugin is installed.

This issue is not a perm issue, he is referring to a block that checks if the user is an OP (if config requires OP to use them) before opening the GUI, i’ll have to look into it when i get some testing time

1 Like

ah so you explicitly check the UserListOps? If so, PEX shouldn’t be doing anything with that – Sponge just patches ICommandSender.canCommandSenderUseCommand (In MC’s implementations). Feel free to poke me if does in fact seem to be weird spongy stuff though.

Most helpful answer I found here, thank you zml

1 Like

Really appreciate such quick work in converting to sponge :smiley: Is there any sort of API documentation or is that still a WIP?

1 Like

All API is exposed through Sponge – there are javadocs available, and all permissions interfaces are available in the org.spongepowered.api.service.permission package.

Just curious, but why is it such a big deal editing the permissions.json file by hand? My opinion it’s a lot less time consuming. Is there something I miss by not using the commands or is it more of a attempt to avoid people posting false bugs related to syntax errors?

Yeah, editing the file by hand is super error-prone. The commands give you tabcompletion of existing data (and soon tabcompletion of available permissions). End goal is to have an ingame gui to work with permissions, but that is pending a GUI API being available in Sponge (kinda long-term)

1 Like

Super fast response. Thanks mate. Great work by the way. I’ve been using pex to do some permissions testing of my projects. So far the only issue I had was the first time I ran pex reload it wiped out my permissions.json file but it only happened the one time.

ooof that’s not particularly good. I think this is due to the same thing I encountered briefly a while ago – the schema version wasn’t set properly when creating the initial file. This should be fixed in the latest dev build, thanks for poking me about it.

What is the PermissionsEx v2.0 (sponge version) equivalent of

pex group <group> add *

because

pex group <group> perm add * true

does not function the same way. Is this just not implemented yet or is there something I am doing completely wrong? Also sorry if you had to answer this before, there isn’t an obvious place to look for this type of stuff because it is not on Issue 1945. Also how would you set a default group besides manually in the JSON I couldn’t find that either in the 1945 Issue? @zml

_ * does not work yet. Alternative, Instead of doing say permissionsex.* JUST do permissionsex

2 Likes

pex group <group> def true

Makes a group with all permissions by default

2 Likes

yeah, as @MoeBoy76 said, set the default permission to true.

To set a default group, add it as a parent to the system default subject – so /pex system default parent add group mydefgroup

1 Like

Correct me if im wrong, pex doesnt work at all.

none of the commands work, the command structure doesnt work even when followed properly, any commands @ pex result in : Too Many Arguments!

soo frustrating :frowning: i really need some way to moderate what permissions my users are getting, just wish sponge had more options because as far as i can tell right now PermissionsEx isnt one of them :confused:

It does actually work. Maybe you’re doing something wrong?

Uncool approach…

Here’s a quick summary of some example usage of the new PermissionsEx:

  • Add perm to group:
    /pex group [group] perm [example.permission] true

  • Put a player in a group:
    /pex user [user] parent add group [group]

  • Mark a group as default:
    /pex system default parent add group [group]

  • Add a parent to a group:
    /pex group [child] parent add group [parent]

  • Create an OP group with all permissions (equivalent to the old, deprecated “*”)
    /pex group [group] def true

  • For mod commands, the permission Sponge gives is
    [modid].command.[commandname].
    (Run the command /pex debug to check what permissions are being checked if you are unsure.)

  • A more specific example, setting up a simple group called Member:
    /pex group Member perm worldedit.navigation.jumpto true
    /pex group Member option prefix [Member]

  • Adding a (currently online) user to that group:
    /pex user [username] parent add group Member

Groups are automatically created by commands as you give them permissions.

I hope that helps solve some of the confusion here, I’m sure Docs for this plugin will be forthcoming in good time.

4 Likes

Thanks this is really helpfull, i should have been more clear with my posts tho sorry about that, my problem right now is that i can’t find a working jar for sponge/forge 1.8 and ive tryed a ton of PEX dev jars soo far, by chance do you have a working version i could use Inscrutable?

Ty very much for the reply :slight_smile: