The situation.
Im currently using a home brewed groups permission code in my site,
but for limited users/groups its ok. Beyond that, the code will take
the fast road to hell.
I started to look in depth at bitwise operations today,
and after much googling, and looking at other code, came up with
Gerard Samuel wrote:
The situation.
Im currently using a home brewed groups permission code in my site,
but for limited users/groups its ok. Beyond that, the code will take
the fast road to hell.
I started to look in depth at bitwise operations today,
and after much googling, and looking at
Marek Kilimajer wrote:
Gerard Samuel wrote:
The situation.
Im currently using a home brewed groups permission code in my site,
but for limited users/groups its ok. Beyond that, the code will take
the fast road to hell.
I started to look in depth at bitwise operations today,
and after much
Gerard Samuel wrote:
Marek Kilimajer wrote:
Gerard Samuel wrote:
The situation.
Im currently using a home brewed groups permission code in my site,
but for limited users/groups its ok. Beyond that, the code will take
the fast road to hell.
I started to look in depth at bitwise operations today,
Marek Kilimajer wrote:
Your checks are something like
if($user['tom'] $perm['read']) echo 'Tom can read';
Only the 3rd bit is checked, all others are ignored and won't do any harm.
Anyway, the clean way of setting permissions is:
$user['tom'] = $perm['execute'] | $perm['write'] | $perm['read'];
5 matches
Mail list logo