Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In addition to #374845: Flag Users / Flag Content would it be possible to let users flag their own profile ONLY?
There is an option "Users may flag themselves" already.
I really like flag and i would like to use it for a lightweight "volunteer for role" like feature.
So my idea is to let users flag themselves (and only themselves).
cheers and thanks for a snappy but powerful module - ronald :-)
Comments
Comment #1
rokr CreditAttribution: rokr commentedSorry the related issue should be #285237: Ability to disallow a flag/unflag operation.
Comment #2
joecanti CreditAttribution: joecanti commentedhi,
Could you not achieve the same functionality simply by letting users flag themselves rather than their profile? What are you trying to achive by flagging profiles over users? If it is to create, for example, a grid of their profile pictures to say 'these people have put themselves forward for the role of...' you could have a 'flag yourself' flag, and then use views to get info from their profile like content pictures?
Joe
Comment #3
quicksketchBy "flag their own profile", you mean if you're using Content Profile module? The flag link already shows up on the user's profile if you're using the (core) Profile module.
Regarding user's flagging only themselves, this usually means you should just add a checkbox to the user's profile edit form, regardless of which module you're using to create your profiles.
Comment #4
rokr CreditAttribution: rokr commentedSorry i was not precise with the term 'profile'. At this point i don't use any profile nodes. Flag type is set to users. Using global flag option. I now want to prevent user2 to flag user1. I can prevent roles to flag but i can't prevent users to flag each other.
cheers, Ronald
Comment #5
quicksketchAh, Flag currently does not have a "Flag only myself" option, since profile modules are better suited to such functionality.
If you're determined to use Flag module, you could manually theme user-profile.tpl.php and use flag_create_link() to only show the link to the owner.
Comment #6
rokr CreditAttribution: rokr commentedYes, thats an option, but that wouldn't prevent users to "hijack" that link to flag other users. :-)
Maybe i think about flagging a content profile node.
Thanks for thinking about it.
cheers, Ronald
Comment #7
quicksketchFlag already contains safe-guards to prevent hijacking of links. When a link is displayed, it is unique for that piece of content and cannot be faked just by typing in the URL manually. So unless a user has seen the link somewhere else, it's unlikely that they would be able to fake it.
That said, I agree that it's not 100% secure, since this is essentially security at the presentation layer, not at the functional layer.
Comment #8
mooffie CreditAttribution: mooffie commentedMarking this a duplicate of #879988: Flag permission for 'own entities'.