haseydesign / flexi-auth

flexi-auth | A user authentication library for Codeigniter
138 stars 122 forks source link

Introduction of group based privileges. #2

Closed tschiemer closed 11 years ago

tschiemer commented 11 years ago

Motivation for the group based/assigned privileges: I have a potentially large and changing userbase, so assigning privileges individually is not an option; as it would be both a hassle (for the admins) and a potential error source (which we really don't want).

The user roles would be rather static so group based access would be the approach to go.

On the other hand the functionality and access is rather widespread and fine-grained so privileges would be better suited for this (ie. changes mean hassle for the developer - yeah right, might get paid for that).

So assigning privileges to groups gives the advantages of both approaches, ease of managability for admin and dev.

The functionality is configurable such that any of group privileges and/or/neither user privileges are actually loaded, ie. it is possible to deactivate the loading of the privileges altogether leaving only the group membership based access control functioning, if so desired.

Codewise mostly a duplicate of the original methods ment for querying and changing the user privileges; for users it just means an additional query during login, for devs it's use as is.

Demo/userguide extended accordingly..

tschiemer commented 11 years ago

Ah, I forgot about the serialization/deserialization cost as the privileges are stored in the session data. Can't quite judge that..

haseydesign commented 11 years ago

Hey tschiemer, It looks like you've been pretty busy adding that awesome feature, and you've even updated the demo and documentation too!

I haven't currently got the time to properly go through and test the code at the moment but will try and jump in on it when I get the chance.

You seem to suggest you're having some kind of problem with serialisation - I'm unsure of what exactly the problem you're having is, is there something I can try and help you with?

DQKev commented 11 years ago

Very cool feature pro, what was what i looked for and tryed to do myself :) :+1:

tschiemer commented 11 years ago

Glad it's a welcome feature! If you see something amiss, i'd happily take care of it, though bit busy aswell..

As I didn't see the general settings in the documentation, I inserted an according page - although one can read them in the config-file, I think it's handy to read about them beforehand..

My comment concerning serialization can be ignored - I got stuck in my own train of thought.

To say the least, overall I think it's a nice and well-made library! many thanks for sharing it

haseydesign commented 11 years ago

@tschiemer I've finally got around to adding your user group privilege feature to the flexi auth library.

I have made a few changes to the code and notably have renamed some of the functions, however, the general code you added has largely been implemented as it was submitted.

I must say I was impressed how well and seamlessly that you added the feature to the existing code base. I've also included your name as a contributor within the library and model files.

Thanks again!