|
Posted by Curtis on 12/29/05 01:53
This is a rather generic question, but since I'm coding in
PHP I thought I'd run it by this group as well as a more
general programming group. I'm sure I can come up with some
hack on my own, but I suspect there's a simple and elegant
approach which has not occured to me.
Our program is a text filter, to be used online on by
forums, personal messaging users, and by Content Management
Systems like Mambo and Drupal.
Let's suppose we have FIVE features, some basic and some
more advanced, and we wish to grant permission use the
different features to various usertype levels/groups--let's
call them A, B, and C. (Something like Member, Editor,
Administrator, in reality.) Something like this:
Feature Usertypes
1 ABC
2 ABC
3 BC
4 BC
5 C
C could use all features, B fewer, A would have only the
basics. (Please bear in mind that the user-level
designations and number can be set according to the needs of
the calling software--this would be fairly-simple if we just
hard-coded a few levels and went from there.)
I'm looking for an elegant way for the calling software to:
a. inform our program of how many and what designation of
usertypes are desired;
b. say which features are assigned to which usertypes;
and
c. for our software to cleanly test for what's what:
if (some test goes here) feature_one(parameters)
{
code
}
--
Curtis
Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
Navigation:
[Reply to this message]
|