I'm trying to extend the security system to allow users to edit any static page that they have created by not the pages of others. Currently there is only the "maintain static page" access right, which does not do what I want.
I managed to get the "Administer" link under every page that the user created (but not under ones which others have created) by hacking node.module's node_link() method. I added a check like this:
else if (user_access('edit own page') && $user->uid == $node->uid)
$links = l(t('edit_page'), "admin/node/edit/$node->nid", array('title' => t('Edit this page.')));
Now the problem is, that when I click on the link I get an "access denied" error. But I don't know how to fix that. I tried changing node_access() to include something similar as the above, but to no avail. It seems that node_access() is not even called when I click on the "Administer" link.
Where do I have to change node.module to allow the user to edit his page?
Any help is greatly appreciated.