The "miscellaneous" panel element "Flag friend links" does not honour the role permissions set for the associated friend flag at Site building >> Flags.

The "Add friend" appears when anonymous users visit the page, even though the Friend flag permissions at .../admin/build/flags/manage/friend have been set not to allow anonymous users to use "Add friend" (in fact the Session API module is not installed, so cannot flag anonymous users anyway).

Comments

rdeboer’s picture

Just adding:

When the anonymous user then clicks the "Add friend" link, they're invited to enter a message to send to the person they want to be a friend with.
It is not until they press "Send" on this form that they get the message "You are not allowed to flag, or unflag, this content."

sirkitree’s picture

Status: Active » Closed (won't fix)

Please reopen if you have some code to provide.

JohnnyW’s picture

Yeah, I have this exact same issue too.

JohnnyW’s picture

Okay, quickly figured it out...

Structure > Pages > User profile template > Edit

Content > "User being viewed" flag > left click on operations flyout wheel (that little wheel on right hand side) > Add new rule

User > User being viwed

Permission > receive friend email notification

CHECK Reverse (NOT)

That should do it ;)

JohnnyW’s picture

Unfortunately, this did not fix the problem as I originally believed.

Any other suggestions?

JohnnyW’s picture

Wait... yes it worked... actually...

Actually, you need to set
"Access settings on Flag Friend Links" to " Only one criterion must pass. "

Also, make sure " Reverse (NOT)" is unchecked.

Okay, that finally fixed it for me, so only logged in users can see the link.

=====

Recap:

Structure > Pages > User profile template > Edit

Content > "User being viewed" flag > left click on operations flyout wheel (that little wheel on right hand side) > Add new rule

User > User being viwed

Permission > receive friend email notification

Next, Access settings on Flag Friend Links > Only one criterion must pass.

Good luck.

JohnnyW’s picture

OMG this is driving me nutty...

Last note and this is it... hope it works for you, because it finally did for me... but then again, maybe this is some intermittent bug on my server...

I decided to uncheck the NOT

And change from User being viewed, to Logged in user....

Plus...

I decided to change to " All criteria must pass. "

I really believe this is the proper settings now.

JohnnyW’s picture

Confirmed, it finally worked with the last note added on #7.