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.
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.












