I am using arckinteractive's role plugin (https://github.com/arckinteractive/Roles/tree/master). After I have defined a few custom roles, how can I override the default roles settings in elgg and set a default custom role to the user when they registered on the site for the first time.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov

ihayredinov - 0 likes
- damieneskimo@damieneskimo

damieneskimo - 0 likes
You must log in to post replies.Listen to 'create','user' event and assign a role.
elgg_register_event_handler('create', 'user', function($event, $type, $user) { // may need ignored access $role = roles_get_role_by_name('my_role'); roles_set_role($role, $user); });it works great. Thanks