apeisa / UserGroups

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

Access tab #26

Closed niklaka closed 10 years ago

niklaka commented 10 years ago

I'll let you guys review and comment on this first instead of just merging it in as it's a bit bigger addition than most of what I've done lately. You'll need to either reinstall or manually hide fields manage_access, view_groups and edit_groups from the edit view for this to work properly (saving wont work if the fields are there twice, obviously).

So no more of the original fields visible nor the access info. Access tab is shown only if the user has user-admin permission.

I decided to implement this using AngularJS as it seemed like a perfect fit for the job (and it was fun ;). The ng part is in its own template file for convenience. Angular's JS file is loaded from CDN atm - probably it should be brought in (or should we use that AngularJS module of yours Antti?).

This implements #11 and also #21 (option b) as when the page starts managing its own access, the inherited values are there as a starting point.

niklaka commented 10 years ago

There were some bugs (forgot to turn debug mode on after re-installing test site from scratch...) but I've fixed them and everything looks good to me now.

I also merged in another bugfix from master so we're all set up to merge this whole thing to master. I'm going to proceed with the merge tomorrow unless you, @apeisa @teppokoivula, have any major objections (will interpret silence as approval).

teppokoivula commented 10 years ago

Honestly didn't have time to read everything super carefully, but based on a quick look this looks great. Only things I could think of were minor questions such as "why $_POST/$_GET instead of $input" and "we really need common terminology (grants, permissions etc.)", but that's just about it.

Definitely nothing to worry about. I believe that this has been tested at some level already, but will try to install it at some point too, just to see how cool the finished thing is in action :)

niklaka commented 10 years ago

I actually never use $_POST/$_GET myself - those were there already. But I think there's some other cleaning up to do as well before we're at 1.0.

We definitely need common terminology. Here's more or less what I've tried to use so far:

Probably checking comments and variable naming at some point would make sense.

apeisa commented 10 years ago

Just tested this and couldn't find a single bug or even improvement. Superb implementation.

apeisa commented 10 years ago

Not sure about how to load angular - probably better to use a module (need to update it for sure). Just thinking of cases where there are module + google cdn with different versions. Sounds like a problem to me in long run.