How do I access the node's uid in hook_node_access()?
The $node parameter is


  Either a node object or the machine name of the content type on which to perform the access check.


When that hook is invoked with the create op, there's no node object available, so $node is a string. 

You're already handling that bit, but you're missing a check on the $op parameter. The reason it's working is because when your function is invoked with the op you're trying to target (probably view), $node is an object and has a uid property. 

With your current code, you'll get one of those notices every time someone other than user 1 tries to create a node, because $node is not an object.

Try re-working your code like this:

function mymodule_node_access( $node, $op, $account)
 {
   if ($op == 'create') {
     $type = $node;
     // You can be reasonably sure that $account is the user who's trying to create the node here.
     // You'll probably want to ignore this bit and check $op specifically for the 
     // actions you're looking for; this is just here to show the workflow.
   }
   else {
     if ($node-&gt;type == 'myCustomType') {
       // Be sure to use the $account var here, not the global $user object
       if ( ($account-&gt;uid != $node-&gt;uid) &amp;&amp; !user_access("view other's posts", $account)) {
       return NODE_ACCESS_DENY;
     }
   }

   return NODE_ACCESS_IGNORE;