apeisa / UserGroups

Adds users groups and page based permission to ProcessWire
GNU General Public License v2.0
11 stars 4 forks source link

After updating to pw 2.6 stable, adding new users is not possible for others than superuser #42

Open apeisa opened 9 years ago

apeisa commented 9 years ago

Trying to add new user (as a non superuser) gives me error:

You do not have permission to execute this module - ProcessPageAdd

I tracked it down to this line: https://github.com/apeisa/UserGroups/blob/master/UserGroupsHooks.module#L157

If we comment that line, we don't get any errors. That cannot be real solution, since we are using before hook, so changing return value without replace is useless (as far as I know).

This error must be due the changes in how ProcessWire handles module permissions. Since we don't actually load ProcessPageAdd anywhere (or do we?), this is much harder to track.

Any ideas @teppokoivula ? Have you tried UserGroups in 2.6 yet? All the other parts seem to work nicely, just this "non superuser adding new users" is causing troubles.

teppokoivula commented 9 years ago

@apeisa: nope, haven't used this with 2.6 yet. It's kind of a long shot, but I'm wondering if the "multi-template/parent user support" broke something here? (Though you're probably right about the module part, so perhaps that's entirely unrelated.)

I'm kind of fully booked right now, so it might take a while before I can take a closer look. Let me know if there's any news though :)

apeisa commented 9 years ago

Hmm, this got even weirder. The user that I used to add new users didn't have any user groups set, only role "site-admin" that gave him bunch of permissions (user-admin, page-edit, profile-edit etc). Right after I gave him one user group, it started working... Without user groups hook installed it works right away.

apeisa commented 9 years ago

"multi template/parent" was my first suspect also, but this is not it (although that might require some love from us at some point).

teppokoivula commented 9 years ago

Any news about this? I'm just about to update one 2.5 site using UserGroups to 2.6, will take a closer look if the issue still persists :)

apeisa commented 9 years ago

Nope, run out of time debugging and since it does work when having user group assigned, didn't bother to dwell deeper. Let me know how it goes for you!