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.

Comments

Scott Reynolds’s picture

Status: Active » Needs review
StatusFileSize
new764 bytes

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.

Scott Reynolds’s picture

StatusFileSize
new757 bytes

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

sirkitree’s picture

Status: Needs review » Fixed
dicreat’s picture

Status: Fixed » Active

Patch don't work for me.

rohitsat’s picture

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

macs1407’s picture

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

Scott Reynolds’s picture

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

or check it again and fixed

access_rebuild() just doesn't really work.

macs1407’s picture

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.

sirkitree’s picture

Priority: Critical » Normal

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

macs1407’s picture

Assigned: Unassigned » macs1407
Category: bug » feature

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

sirkitree’s picture

Assigned: macs1407 » Unassigned
Status: Active » Closed (duplicate)
timlie’s picture

StatusFileSize
new1.36 KB

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

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

sirkitree’s picture

Version: 6.x-1.0-beta5 » 6.x-1.x-dev
Category: feature » bug
Status: Closed (duplicate) » Needs review
Scott Reynolds’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta5
Category: bug » feature
Status: Needs review » Needs work

I would instead do this

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.

timlie’s picture

Version: 6.x-1.0-beta5 » 6.x-1.0-rc2
Category: feature » bug
Status: Needs work » Needs review
Scott Reynolds’s picture

Version: 6.x-1.0-rc2 » 6.x-1.x-dev
Status: Needs review » Needs work

doh! cross post! Most def a bug report.

Scott Reynolds’s picture

Priority: Normal » Critical

oops it is critical

timlie’s picture

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...

Scott Reynolds’s picture

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

dicreat’s picture

Patch #12 work for me. Thanks!

sirkitree’s picture

Component: Code » Flag friend access
Status: Needs work » Needs review
StatusFileSize
new1.67 KB

Patch in #12 with modification as suggested by Scott in #14: is this what you meant Scott or is the second hunk not needed at all?

Scott Reynolds’s picture

Status: Needs review » Needs work

First hunk is all you should need.

sirkitree’s picture

Status: Needs work » Fixed

Committed. accidentally committed install file too with it ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

quiptime’s picture

The problem with the flag friend access module is NOT fixed !!!

Please make the patch code available in your contributed releases!

The point is, the actual releases 6.x-1.0-rc2 and 6.x-1.x-dev don't contributed!!! Remove this from list!!!

Please read my post http://drupal.org/node/486704#comment-2742214

quiptime’s picture

StatusFileSize
new8.25 KB

Module with patch tested. It works.

But, you forgot the update hook in the install file.

 

Friend Access Control and Panels

Another thing is the Panels module. Panels does not work with Friend Access Control. This means that the Friend Access Control setting in a node is ignored by Panels.

Chaos Tools (CTools) Plugin Flag Friend Access

I have developed a Chaos Tools plugin so that Friend Access Control can be used with Panels.

sirkitree’s picture

@quiptime Your patch has nothing to do with this issue thread - please open a new issue and explain when you've got going on there.

quiptime’s picture

You're right. Please move my post #26 to thread http://drupal.org/node/486704.

sirkitree’s picture

@quiptime - d.o does not provide a means to move posts - you'll have to do this manually. However, that issue also has nothing to do with ctools, you need to create a new issue for the ctools things you've added.