Access denied for author after creating node
dicreat - June 7, 2009 - 14:58
| Project: | Flag Friend |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs work |
Description
I'm using Flag friend access control module. After creating a node with 'Only My Friends' option, author gets access denied error and don't see his node. Only admin and friends can access this node.
After submitting node, in 'node_access' I see new entry:
nid=367, gid=3, realm=flag_friend, grant_view=1, grant_update=0, grant_delete = 0
When I try a rebuilding permission, this entry change to:
nid=367, gid=0, realm=all, grant_view=1, grant_update=0, grant_delete = 0
and now everyone can access this node.
If admin creating a new node with 'Only My Friends' option, there is no error. But if admin try to make this node public end press 'edit' link, the 'Only My Friends' option gone away.

#1
in regards to your first problem
doh! sry. The attached patch should fix that goof.
In regards to your second issue I created a new ticket
#486704: Rebuilding node_access doesn't work with flag_friend_access module.
In that issue, I detail howto fix this problem, so if your a coder take a swing at it.
#2
...doh wrong patch. Please use this one.
#3
Comitted: http://drupal.org/cvs?commit=223182
#4
Patch don't work for me.
#5
Hi,
When creating a page if an author marks "only for my friends" (Friend Access Control), he gets a message like page created and then access denied. And his friends can see the page but he can not. Somebody please help me with this. Its urgent.
Thanks a lot in advance,
RohitS
#6
hi all since I have the same problem and I have not been able to resolve this I already explained it but do not quite understand how to solve and it takes 1 month with this problem your help agradeceria
#7
edit the node and uncheck that.... and bam fixed...
or check it again and fixed
access_rebuild() just doesn't really work.
#8
a question like that could do something similar when you create a blog entry only to see my friends and me if I could help agradeceria muchisimo or another module that could help me. because I too have used RELATIONSHIP USER and I work but I want aparesca the checkbox checked by default and not visible to the user rather not have the option of the Czech Republic the box.
#9
I really can't understand what your problem is #8.
#10
because my problem is that I want when creating a blog entry only to see my friends and I, as I do that
#11
Please reference #486704: Rebuilding node_access doesn't work with flag_friend_access module
#12
This patch should fix the issue as it is not fixed in RC2.
Though it still does not fix http://drupal.org/node/486704
#13
#14
I would instead do this
<?phpif (!empty($friends)) {
$grants['flag_friend'] = array_keys($friends);
}
$grants['flag_friend'][] = $GLOBALS['user']->uid;
?>
Thats the only change needed. You don't want to write TWO records to node access. creates a mess and adds unneeded overhead.
#15
#16
doh! cross post! Most def a bug report.
#17
oops it is critical
#18
This seems to work.
Altough my solution came from the drupal api, where they use TWO records :-)
http://api.drupal.org/api/drupal/developer--examples--node_access_exampl...
#19
Right that case it is required in the example. Not required here.
#20
Patch #12 work for me. Thanks!