Well, even today I found some more problems with uc_product_access(). I'm pretty sure they're fixed now, so this is the version that's in the Bazaar repository:
<?php
function uc_product_access($op, $node) {
global $user;
$type = is_string($node) ? $node : (is_array($node) ? $node['type'] : $node->type);
if ($type == 'product') {
$type = '';
}
else {
$type .= ' ';
}
switch ($op) {
case 'create':
return user_access('create '. $type .'products');
case 'update':
case 'delete':
if (user_access('edit '. $type .'products') || (user_access('edit own '. $type .'products') && ($user->uid == $node->uid))) {
return TRUE;
}
}
}
?>


Joined: 08/07/2007