Jump to content






Photo - - - - -

How do you define 'staff'?

Posted by Michael, 01 September 2008 · 499 views

CSC Development
Continuing with our theme earlier of Classifications, I'd like to try and simplify this concept.  What I'd like to do is to try and come up with a concise way of saying "you are staff" or "you are not staff".  I want to run a few things by you and hopefully get some feedback about what I'm proposing.

First off, do we need to say a member is staff only in the context of a plugin, or is it always going to be a simple question of your are staff or you are not?  For example, I might create a setting for each user group that says "this is a staff group".  If I set this to No for the Members group, but then I also have one Member who I want to be staff in my Shops plugin, is he staff when it comes to looking at members' public profiles, meaning he would then have the option to view staff-only fields or to make changes?  One would be inclined to say Yes to that question, I should think.

Going with a Yes there, I think we end up with the following as the logical setup for saying who is staff and who isn't.  Each group should have a yes/no setting for the Core group permissions that says whether the group is a staff member or not.  This setting is global, and cannot be overridden by plugin permissions.  Each plugin then would have the option of adding additional groups and/or members (although right now I can't see why a plugin would need to add a whole group).  Then, the Core component needs a library function to return whether a particular member is staff or not.  It will check the Core group permissions and return true if they are in one of those groups.  Otherwise, it will loop through each installed plugin and call a library function that that plugin needs to create to return its staff groups/members.  As soon as something says "this dude is staff", the Core function returns its true value, otherwise it will keep checking each plugin and eventually return false if they aren't a staff in any of them.

I really do need some feedback on this pretty quickly, as I have to start coding things that check for whether the person viewing the page is staff or not.  Please do ask questions if any of this is confusing.




Yeah that sounds a pretty good way of doing it. How would the plugins be returning this data, is it a simple PHP file that developers make, or is it cached in the database somewhere?
Each plugin will need to have a section where additional staff can be assigned.  The way I have this planned out in my head, a plugin could do it either way, either just storing the info about who is staff in the database or by caching it.  The core code just needs to call a function in the plugin, and that plugin function just needs to return a boolean, how it arrives at that boolean value is up to the plugin author.

My Picture

0 user(s) viewing

0 members, 0 guests, 0 anonymous users

Recent Entries

Search My Blog

May 2012

S M T W T F S
  12345
6789101112
13141516 17 1819
20212223242526
2728293031  

Digg

Twitter

Recent Comments

Latest Visitors