On our site users can post nodes and select to sell them or make them free.
When user make new Node Access Product for own node, he can't access this node by himself any more. (He still can access "edit node", but not "view")
Sorry for disturbing you, can you help , please?

Comments

danielb’s picture

I haven't give access to the author in my module. I will find out if this is something I should do.
On my sites I have been using additional node access modules to provide this feature.

denis_sle’s picture

Status: Active » Closed (fixed)

I've added to the end of function ec_nodeaccess_node_access_records this code

...

$grants [] = array (
				'realm' => 'ec_nodeaccess_author', 
				'gid' => $node->uid, 
				'priority' => is_numeric ( $priority = variable_get ( 'ec_nodeaccess_priority', 0 ) ) ? $priority : 0, 						
				'grant_view' => TRUE, 
				'grant_update' => TRUE, 
				'grant_delete' => TRUE );

    return $grants;

...

and to the end of function ec_nodeaccess_node_grants

...

    $grants ['ec_nodeaccess_author'] = array ($account->uid);
     return $grants;

...

and it works :)