[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-developers] PHPGW_ACL_* constants
From: |
Bradley W. Langhorst |
Subject: |
[Phpgroupware-developers] PHPGW_ACL_* constants |
Date: |
11 Oct 2002 17:09:14 -0400 |
It makes a lot of sense to have some constants for the various levels
define('PHPGW_ACL_READ',1);
define('PHPGW_ACL_ADD',2);
define('PHPGW_ACL_EDIT',4);
define('PHPGW_ACL_DELETE',8);
define('PHPGW_ACL_PRIVATE',16);
define('PHPGW_ACL_GROUP_MANAGERS',32);
even better - with this scheme you can store all the acl info in one 8
bit field and build new structures like
00000101 (read and edit) from
00000001 (read) and
00000100 (edit)
but then i find this in class.acl.inc.php - which throws a monkey wrench
into the scheme...
00652 $accounts = Array();
00653 if ($db2->num_rows() == 0)
00654 {
00655
$grants[$GLOBALS['phpgw_info']['user']['account_id']] = 31;
00656 return $grants;
00657 }
apparently 31 or (00011111) means "ALL"
That says (read, add, edit, delete and private).
why not use 11111111 (or 255) for all or "full control" instead?
Why not have a new constant PHPGW_ACL_ALL = 255 or whatever?
While i'm on the subject why are
define('PHPGW_ACL_PRIVATE',16);
define('PHPGW_ACL_GROUP_MANAGERS',32);
in here at all?
they're really sort of "Override" flags and are properties of the event
not the user who is accessing that event
ie one can have permission to read, add, edit, or delete something
one can't have permission to "private" something or "group_manager"
something
Events could be marked private with a bit flag somewhere
( there is already an is_public flag in the phpgw_cal table. It appears
to be used.)
I don't know what the group_manager flag is used for yet.
brad
- [Phpgroupware-developers] PHPGW_ACL_* constants,
Bradley W. Langhorst <=