CommandHelper

CommandHelper

46.5k Downloads

CommandHelper doesn't seem to be playing well with PermissionsEx

LadyCailinBot opened this issue ยท 18 comments

commented

CMDHELPER-2866 - Reported by jacklink01

All players can do all of the commands defined in the config.txt even if they don't have the commandhelper.alias. permission for that label. Put simply, it is not possible to use the labeling system as a method to provide permissions for commands because EVERYONE has the permission no matter what I do.

And before you suggest I try a million different things, I'm going to let you know what I have already tried... :)

I've searched my permissions file for ch.alias.* or any other ch.X or commandhelper.X permissions and none exist except for the ones needed for the labels.
I've tried using '-ch.alias.' on groups to remove the permissions of a specific group, but the players within the group can still use commands with this label.
I am using the latest dev build of CommandHelper #2485-b4e811d
I am using the latest version of PermissionsEx v1.20.4

I have a lot of command aliases and I would much prefer using the labeling system to provide permissions for commands rather than coding if(has_permission('XXX')....etc on every command. Thanks.

EDIT: I've additionally noticed that the has_permission() function doesn't appear to be working either. It always returns false. I've tried giving a permission to a group and directly to a player, but has_permission() still returns as false.

commented

Comment by jacklink01

Also, it is important to note that the use of group permissions works with PEx. i.e. ~Admin/Mod/Trusted/-Member/-Builder:/command = /longercommand

commented

Comment by LadyCailin

As a test, try setting your groups and all references to them to be lowercase, and see what happens then. This may be related to WORLDEDIT-2955.

commented

Comment by jacklink01

Well, using groups is the only thing that IS working. It's the creation of specific perms that isn't working: 'ch.alias.' Doesn't work if I assign that perm to a specific player OR a group.

commented

Comment by EntityReborn

Did you try the lowercase trick?

commented

Comment by jacklink01

I can try it, but do you mean for my labels or groups? Because I've tried not even using groups and just assigning label perms directly to players and it didn't work. Maybe I'm confused by what you mean.

commented

Comment by jacklink01

Maybe I wasn't clear enough in my original comment about using groups. Groups are working fine with CommandHelper and PEx even with capitals. It is the node perms made by using labels that aren't working.

commented

Comment by EntityReborn

has_permission works for me:

{{>eval has_permission(import, abc)
[11:07:41 INFO]: CH: Running original command from a MCCommandSender ----> /eval has_permission(import, abc)
[11:07:41 INFO]: false

pex user __import add abc
[11:07:51 INFO]: Permission "abc" added!
eval has_permission(import, abc)
[11:07:53 INFO]: CH: Running original command from a MCCommandSender ----> /eval has_permission(import, abc)
[11:07:53 INFO]: true}}

However, aliases aren't working for me, and are stuck permissive as you mentioned. I'll take a look at this.

I tested aliases with the following, with a completely clean, no privileged user, and could run it:
{{eval:/eval $ = msg(eval($))}}

commented

Comment by jacklink01

Thanks for your help. Hope you can figure it out. I'll have to check again about has_permission().

commented

Comment by EntityReborn

I'm pushing a commit that should address this issue now. Please try build 2575 when you can and let me know.

commented

Comment by EntityReborn

Be aware, the fix might not be what you think; alias based permissions don't restrict calling that alias, they restrict restricted functions within that alias, such as eval() in my example above. I'm aware the docs are somewhat unclear on this, but this is the intended purpose.

commented

Comment by jacklink01

Well to be honest, that makes the aliases useless. You might as well just use the commandhelper.func.use.XXX permissions for the restricted functions. I don't see how the aliases would help you at all. It would be much nicer if one could use the aliases to keep their commands organized within different permissions instead of having to take up lines of code to check for perms on each command. But, if that's not the intention of the aliases, then what is?

commented

Comment by wizjany

What version of PEX and WorldEdit do you have?

commented

Comment by jacklink01

WorldEdit #2990
PermissionsEx v1.20.4

commented

Comment by jacklink01

CommandHelper uses WorldEdit?

commented

Comment by EntityReborn

It imports some functionality from it, exposes some functions.

commented

Comment by jacklink01

Yes. Okay. Guess I just didn't see how that pertained to the issue. Thx.

commented

Comment by LadyCailin

This may be an issue with WEPIF, especially if multiple things are broken. (Permissions haven't been touched in a while.) I shade in WE though, so you don't actually need WE to run. I'll make sure things are up to date.

commented

Comment by jacklink01

Permissions on all other sk89q plugins work fine. Its just CommandHelper that has the issues for me