Jump to content

Admin / User


Kemik

Recommended Posts

Hello all,

 

My current admin and user system works off of numbers. E.g. Guests = 0, Logged in users = 1, Admin = 9.

 

I'm currently designing a league script and need to think of another way to "rank people". Each team in the league has at least one "leader". The leaders get more access compared to the normal team players, think of it like admins have more access than users.

 

However, both team players and team leaders are not site admins and a leader for one team should not be able to edit someone elses team.

 

How do you think I could possibly do this, keeping the system secure and database queries to a minimum.

 

Thanks.

Link to comment
Share on other sites

So it sounds like what you want to implement is a group system on top of your current user rights system.  The base element would be a group.  By default all users might belong to some group, say "Normal".  However within a group users could be assigned rights.  For instance, Joe could be given full write access within the Normal group while Alex only has read access.  You could then create more groups, such as "League 1", and assign users to that group.  Let's run through a full scenario.

 

Joe is the site administrator and has super user rights.  This means he belongs to every group as a group owner and has the ability to assign other members to groups and assign their rights within a group.

 

Joe creates a group "League 1" to which he is automatically added as an owner.  He then adds Alex to the league as an owner.

 

As an owner Alex and adjust the rights levels of members within his group Alex can post various things, edit things, and add new members to the group.  Each member he adds will have read access by default.  There may be some mechanism in place to promote their access level.

 

Alex adds Roselin to the group.  She is now a member of the Default and League 1 groups.  This means that she can read both groups' material (since she has read access).

 

I can talk more about databases and how to implement this sort of thing if you'd like. I think at the most basic level it would involve adding a new table to the database, and some object to act as a mediator between a domain model and an access model.

Link to comment
Share on other sites

Well I already have "teams" and "team_members" tables.

 

It's simply trying to come up with a structure for permissions. I can create a boolean or tiny int and have the same admin system with the team as with the site, however the bit I'm stuck on is making only members of the team be able to visit their team pages and only the team leader to have the extra permissions.

Link to comment
Share on other sites

Ah, thanks for the link!

 

I've been reading up on MVC all day actually. I've been looking if using a framework (specifically CodeIgniter) would make the development and management of my code easier. It looks like a step along a different path compared to OOP and even though it looks easy enough for me to handle it would mean I'd need to learn a few more process' and syntax.

 

I'll take look at the link you gave and make my decision.

 

Thanks again.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.