SLaVKa wrote:
Hey guys... implementing a permission system and just wanted some advice.

If i have permission A
which has implied permissions B and C

How do the permissions relate to each other, for eg if I select permission A to true, that implies that permission B and C must be set to true, but then if I set B to false or C to false, or both does that affect permission A?

Assuming that B, and C dont have implied rights you should be able to turn both of them off while leaving A on, but then that breaks the rule for A having implied permissions B and C.

Any help appreciated.
I dont know the Grammar for specifying logic anymore, but

IF A implies B + C, then reverse logic should imply that if !( B && C) == !A. In other words, it shouldnt matter which of B or C is false.

Or you could specify if ((!B) || (!C)) then A==FALSE.

But more importantly, YOU are specifying the permission system, so you must define the priority, implications, etc..

I would personally prefer a rule which had A = ( B && C ). In other words, A does not imply B and C are true, but is defined by there being true, or is dependent. The possible confusion wil come when you specify permissions as 'implications' rather than as combinations of 'conditions'.

My 2 cents.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to