Create magento admin user by custom script.
Create magento admin user by custom script.

Generally magento admin user can be created by web interface.That the super user can create different admin user by providing different permission to that user.To Create magento admin user you can also do by custom script.By using custom script you can create a new admin user and also you can assign all resources to that user.So lets see how to Create magento admin user ?

First Method:

By web interface:

This is the easiest and simple method if you don’t have any knowledge in programming.For that you have logged in as super user which have all the permission to do on admin panel.

  • Logged into admin dashboard
  • Navigate to system => Permission => Users
  • Click on “Add New User” button
  • Then filled up all the required field
  • Click on User Role of left tab
  • Select Role
  • Click on Save User button
  • Finally you have created a new admin user.

So if you like to assign to access limited features for admin user then you need to create a new role and then assign that role to the user.Then depending upon the roles accessibility the respected admin user can only access that much of feature.So lets see how we can generate new role.

  • Logged into admin dashboard
  • Navigate to system => Permission => Roles
  • Click on “Add New Role” button
  • Type Role Name e.g: customrole
  • Click on Role Resources of left tab
  • Select custom of “Resource Access” drop-down.
  • Select the resources you want to assign for that role.
  • Click on Save Role.
  • Finally you have created a new role.
  • Then you can assign this role to the new or ant admin user.

Second Method:

By custom script:

The above description was related to web interface creation. But if you don’t have that much permission and have FTP access then you can create by custom script.

Lets see how to Create magento admin user by custom script ?
[crayon-5e4a313e93bd9374343295/]
In the above script I have just display the syntax to Create magento admin user.But you can directly use the below script for creating admin user.
[crayon-5e4a313e93be2775086672/]
The default Administrator’s Id is 1 which act as super user.So I have set id as 1 by setRoleIds(array(1)) to create a super user.

Create magento admin user
The following two tabs change content below.
Jyotiranjan is one of passionate programmer who has been working in magento since 6 years and in the mean time he has developed enormous amount of modules and customisation of sites. He loves to write blogs and travel for long journeying.

Latest posts by Jyotiranjan Biswal (see all)

Tagged on:                             

Leave a Reply

Your email address will not be published. Required fields are marked *