Implemented ability to check for more then one right for get_lists:

@param int $required=EGW_ACL_READ required rights on the addressbook or multiple rights or'ed together,
to return only listss fullfilling all the given rights
This commit is contained in:
Jörg Lehrke 2009-08-22 11:55:10 +00:00
parent ceaf32919f
commit 3188333c45

View File

@ -874,7 +874,8 @@ class addressbook_so
/** /**
* Get the availible distribution lists for a user * Get the availible distribution lists for a user
* *
* @param int $required=EGW_ACL_READ required rights on the list * @param int $required=EGW_ACL_READ required rights on the list or multiple rights or'ed together,
* to return only lists fullfilling all the given rights
* @param string $extra_labels=null first labels if given (already translated) * @param string $extra_labels=null first labels if given (already translated)
* @return array with id => label pairs or false if backend does not support lists * @return array with id => label pairs or false if backend does not support lists
*/ */
@ -885,7 +886,7 @@ class addressbook_so
$uids = array(); $uids = array();
foreach($this->grants as $uid => $rights) foreach($this->grants as $uid => $rights)
{ {
if ($rights & $required) if (($rights & $required) == $required)
{ {
$uids[] = $uid; $uids[] = $uid;
} }