I want to be able to add and remove a role to a user via a simple click of a button on almost any node. (Specifically the plan is to allow a user to give themselves a role that would give them extra editing powers, but so that they can remove it when generally browsing the site so all the editing options don't clog up the UI).
The best method I could think of for this is to have two nodes, and set up a rule so visiting these nodes added or removed the user role. I could then create simple menu links that linked to these nodes.
Essentially what I have set up is one rule which goes:
Event: Content is Viewed Condition: Node is of alias - node url Action: Add user role - Edit Powers
This rule works fine. When the node is visited the role is added to the user. However the reverse rule doesn't work despite being nearly identical to the other. It reads:
Event: Content is viewed Conidtion: Node is of alias - node url Action: Remove user role - Edit Powers
However visiting this URL doesn't remove the user role. The question here is two-fold.
a) Why would the rule not be working, and why can't it remove a role from the user?
b) Is this a really complex way of achieving something that might be quite simple? At the moment I assume this rule is effectively being checked when any user visits any page, which I'm sure isn't great from a resource point of view - but I couldn't think of an easier way to do it with flags etc. So please do advise if there is an easier way.
Thanks in advance for any help.