I looked a lot of places and couldn't find a way to filter the results of a view based on the nodes a user could actually edit. So I used Views PHP Filter and some custom code to make it happen.
Comments and improvements welcome.
global $user;
$type = array();
$nid_list = array();
$perms = array();
foreach($user->roles as $role) {
$role_perms = db_fetch_array(db_query("SELECT `role`.`name`, `permission`.`perm` FROM {role} INNER JOIN {permission} ON `role`.`rid` = `permission`.`rid` WHERE `role`.`name` = '%s'", $role));
$perm_temp = explode(", ", $role_perms['perm']);
$perms = array_merge($perms, $perm_temp);
}
foreach($perms as $perm) {
$pos_edit = strpos($perm, "edit");
$pos_content = strpos($perm, "content");
$pos_products = strpos($perm, "products");
if (($pos_edit !== false) && ($pos_content !== false)) {
$perm = substr($perm,9,strlen($perm)-16);
if (!in_array($perm, $type)) {
$type[] = $perm;
}
} else if (($pos_edit !== false) && ($pos_products !== false)) {
$perm = substr($perm,9,strlen($perm)-18);
if (!in_array($perm, $type)) {
$type[] = $perm;
}
}
}
foreach($type as $ctype) {
$nids = db_query("SELECT `node`.`nid` FROM `node` WHERE `node`.`type` = '%s'", $ctype);
while($row = db_fetch_array($nids)) {
$nid_list[] = $row['nid'];
}
}
asort($nid_list);
return $nid_list;