This project is not covered by Drupal’s security advisory policy.

This module allows to grant or remove roles by simply clicking a link. Wich roles are removed or granted depends on the attrbutes data-add-role od data-remove-role.

It is also possible to add/remove more than one role by simply separate multiple roles by a comma.

Important note

Make sure to only allow certain roles to be added or removed by clicking an element. Otherwise it would be possible for attackers to get any role they want. By default this module prevents users from getting any role.

Examples:

Add single role:

<div data-add-role="example_role">Grant <em>example role</em></div>

Remove single role:

<div data-remove-role="example_role">Remove <em>example role</em></div>

Add multiple roles:

<div data-add-role="example_role,second_role,third_role">Grant multiple roles</div>

Remove multiple roles:

<div data-remove-role="example_role,second_role,third_role">Remove multiple roles</div>

It is also possible to add and remove roles at the same element:

<div data-add-role="example_role,second_role" data-remove-role="third_role,fourth_role">Remove multiple roles</div>

Redirect to another destination after adding / removing roles:

<div data-add-role="example_role" data-href="/imprint">Grant <em>example role</em></div>

The data-href attributes redirects the user to the given page.


This project is developed and maintained by Kommune3.
It is sponsored by HeilpraktikerAusbildung24.
Supporting organizations: 
https://www.drupal.org/kommune3

Project information

Releases