Welcome Guest, Not a member yet? Register   Sign In
Implementing MM_USERGROUP in codeIgniter
#2

[eluser]osci[/eluser]
I'm currently working on something like this in my auth system.
I haven't decided thought which roadmap i should select.
I'll explain them both.

Roadmap 1
Tables
user (id, username, psswd)
roles (id, descr)
user_roles (user_id, role_id)

This way you can assign to a user as many roles as you want and whenever you need you'll check if the user has the desired role.

Roadmap 2
Tables
user (id, username, psswd, role_id)
roles (id, descr, strength)
Let me give an example for this.
role sysadmin strength 100
role admin strength 90
role publisher strength 70
role uploader strength 50
role editor strength 50
role member strength 10

let's say you have a function you want available to publisher. the publisher's strength is checked and if the user's strength is >= the publisher's strength the user is allowed. this is more like a hierarchical auth system.

I started writing my auth using the first roadmap as I can explicity check if a user is in the allowed array of users ie user_role_is('admin', 'helpdesk'). I like this roadmap more but I don't know if there are any drawbacks yet.


Messages In This Thread
Implementing MM_USERGROUP in codeIgniter - by El Forum - 02-10-2011, 03:03 AM
Implementing MM_USERGROUP in codeIgniter - by El Forum - 02-10-2011, 03:53 AM
Implementing MM_USERGROUP in codeIgniter - by El Forum - 02-10-2011, 04:03 AM
Implementing MM_USERGROUP in codeIgniter - by El Forum - 02-10-2011, 04:39 AM
Implementing MM_USERGROUP in codeIgniter - by El Forum - 02-10-2011, 05:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB