[geeklog-devel] Suggested new SEC_ functions

Joe Mucchiello joe at ThrowingDice.com
Sun Oct 4 15:06:04 EDT 2009


At 02:09 PM 10/4/2009, Dirk Haun wrote:
>And since one of the next steps usually involves passing all those
>permission values to SEC_hasAccess, I came up with SEC_hasAccess2 (for
>lack of a better idea for a name - suggestions welcome) which will do
>the same but accept that $PERM array instead of 6 separate values.

Just use SEC_hasAccess. If param1 is an array, assume it is the $PERM array:

function 
SEC_hasAccess($owner_id,$group_id=0,$perm_owner=0,$perm_group=0,$perm_members=0,$perm_anon=0)
{
     global $_USER;

     if (is_array($owner_id)) {
         $group_id = $owner_id['group_id'];
         $perm_owner = $owner_id['perm_owner'];
         $perm_group = $owner_id['perm_group'];
         $perm_members = $owner_id['perm_members'];
         $perm_anon = $owner_id['perm_anon'];
         $owner_id = $owner_id['owner_id'];
     }
// etc.
}


----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list