I know about assigning roles and permission in DRUPAL
admin login where admin can add user and even add new roles (check here) to the new users.
I have a basic registration form in my page and while user register I want to assign roles to them for example - employee, superuser and admin roles.
How do I do it, do I have create a new module and may be use the ROLE
module functionality in Core DRUPAL
.
I have also checked this Link which explains about basic Users, roles and permissions in DRUPAL but it does not answer my question.
So
I need to create new user in Drupal from my own Registration form.
I need to have my own custom roles (eg. employee, superuser and admin roles) - This Link might help me in this
This new user which are registering from my own custom registration form, should be assigned with this custom roles(eg. employee, superuser and admin roles).
Can some please tell me how do I do this in Drupal 7
or Does anyone knows any Drupal
modules which can help me do this efficiently or should I go with own PHP code.
which will be more efficient way for doing this.
Thanks in advance :)
user_save
... but reading from here api.drupal.org/api/drupal/modules%21user%21user.module/function/… it seemsuser_save
is a good option