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

Scott Reynolds - June 9, 2009 - 19:13
Status:active» needs review

in regards to your first problem

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.

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.

AttachmentSize
flag_access_author.patch 764 bytes

#2

Scott Reynolds - June 9, 2009 - 19:18

...doh wrong patch. Please use this one.

AttachmentSize
flag_access_author.patch 757 bytes

#3

sirkitree - June 9, 2009 - 19:24
Status:needs review» fixed

Comitted: http://drupal.org/cvs?commit=223182

#4

dicreat - June 10, 2009 - 06:09
Status:fixed» active

Patch don't work for me.

#5

rohitsat - August 9, 2009 - 12:58
Version:6.x-1.x-dev» 6.x-1.0-beta5

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

macs1407 - August 21, 2009 - 02:04

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

Scott Reynolds - August 21, 2009 - 02:10

edit the node and uncheck that.... and bam fixed...

or check it again and fixed

access_rebuild() just doesn't really work.

#8

macs1407 - August 21, 2009 - 12:44

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

sirkitree - August 25, 2009 - 23:46
Priority:critical» normal

I really can't understand what your problem is #8.

#10

macs1407 - August 27, 2009 - 19:10
Category:bug report» feature request
Assigned to:Anonymous» macs1407

because my problem is that I want when creating a blog entry only to see my friends and I, as I do that

#11

sirkitree - September 14, 2009 - 18:18
Assigned to:macs1407» Anonymous
Status:active» duplicate

Please reference #486704: Rebuilding node_access doesn't work with flag_friend_access module

#12

timlie - November 11, 2009 - 19:40

This patch should fix the issue as it is not fixed in RC2.

Though it still does not fix http://drupal.org/node/486704

AttachmentSize
11092009.patch 1.36 KB

#13

sirkitree - November 11, 2009 - 19:44
Version:6.x-1.0-beta5» 6.x-1.x-dev
Category:feature request» bug report
Status:duplicate» needs review

#14

Scott Reynolds - November 11, 2009 - 19:44
Version:6.x-1.x-dev» 6.x-1.0-beta5
Category:bug report» feature request
Status:needs review» needs work

I would instead do this

<?php
if (!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

timlie - November 11, 2009 - 19:45
Version:6.x-1.0-beta5» 6.x-1.0-rc2
Category:feature request» bug report
Status:needs work» needs review

#16

Scott Reynolds - November 11, 2009 - 19:46
Version:6.x-1.0-rc2» 6.x-1.x-dev
Status:needs review» needs work

doh! cross post! Most def a bug report.

#17

Scott Reynolds - November 11, 2009 - 19:46
Priority:normal» critical

oops it is critical

#18

timlie - November 11, 2009 - 19:58

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

Scott Reynolds - November 11, 2009 - 20:01

Right that case it is required in the example. Not required here.

#20

dicreat - November 12, 2009 - 05:35

Patch #12 work for me. Thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.