Kimai_Database_Mysql::is_watchable_user PHP Method

is_watchable_user() public method

Checks if a user (given by user ID) can be accessed by another user (given by user array):
See also: get_watchable_users
Author: sl
public is_watchable_user ( integer $user, integer $userID ) : boolean
$user integer user to check for
$userID integer user to check if watchable
return boolean if watchable, false otherwiese
    public function is_watchable_user($user, $userID)
    {
        $userID = MySQL::SQLValue($user['userID'], MySQL::SQLVALUE_NUMBER);
        $watchableUsers = $this->get_watchable_users($user);
        foreach ($watchableUsers as $watchableUser) {
            if ($watchableUser['userID'] == $userID) {
                return true;
            }
        }
        return false;
    }
Kimai_Database_Mysql