I'm trying to get a behavior when a link is clicked, a role is applied to a user.

My use case is to allow a registred user to step into another type of user. Example is airbnb.com. You are a renter but once you click a certain menu link you become a host and get new menu items to then list your house.

I want to give permissions and access to certain areas of the site only when someone decides to unlock it.


You can use Rules for that. The configuration can be({{}} are placeholders, do not use on the real values):

  1. React on event "Content is viewed"
  2. Condition: Data comparison (Parameter: Data to compare: [node:nid], Data value: {{NID from the node you're using to trigger this role activation}})
  3. Action: Add user role (Parameter: User: [site:current-user], Roles: {{the role you want to add}})

Flag module + @pedrorocha is quite a good tandem, instead of going to link, everything happen in one place, plus changing your link flag into different text ajaxly.

  • I agree with you, as I don't like much to base Rules on visiting some URL, cause it's easy to break, but if he doesn't have demand for a Flag in his structure, creating one only for this purpose would not be so good neither. Anyway, any combination with Rules will help him. – pedrorocha Sep 28 '15 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.