I understood the meaning of roles for the users and how to manage them, but I didn't understand well the meaning of the REST roles and if they interact/interfere each other.

I couldn't find any example on internet.


This is taken directly from Inchoo http://inchoo.net/magento/configure-magento-rest-and-oauth-settings/ per BOOMER's comment about posting the answer. I give them full credit for this answer.

1. Creating oAuth Consumer

Since Magento REST service is working only with oAuth authentication, we need to create oAuth consumer application first.

Navigate to System->Web Services ->REST oAuth Consumers. OAuth Consumers grid is shown. We can register any number of Consumers in Magento that can be used by various third party oAuth clients to access our Magento resources.

Click on “Add New” button to add new Consumer Application. On “New Consumer” screen insert some custom name. Key and Secret fields are disabled, and we just need to copy their values somewhere in text file for later usage (We need them for our oAuth authorization in order to be able to consume REST from Magento). We can leave the Callback URL and Rejected Callback URL fields empty for now. Save Consumer app.

2. Creating and configuring Admin roles

Like I mentioned in last article about this topic, we need to create permissions for specific user type in order user to be able to consume our Magento REST service and access necessary resources. Let’s navigate to System -> Web Services -> REST Roles. REST Roles grid is shown with two user types by default:

Customer Guest Let’s say, for example, that we are going to use the Magento REST service for updating Products and Customers, and we need Admin permissions for that. We don’t want to enable neither Guest or Customer user to be able to do that. Let’s create new Admin role.

Click on “Add admin Role” button in top right corner. “Add new Role” screen is shown. In the field “Role name” enter for example “Administrator”. Click on “Role API resources” tab on the left. “Role Resources” screen is shown and here we need to check specific permissions that our Administrator user will have on specific resource. Of course, we have an option to select “All”, but be careful with that. Click on “Save Role” button in top right corner of the screen.

3. Configuring resource attributes and access permissions

Navigate to System->Web Services ->REST attributes. Here we have grid with three user types listed:

Admin Customer Guest

Let’s click on “Admin” in order to configure REST resource attributes that Admin will be allowed to access. Under “User type resources” screen, select resources that Admin user type can access or select “All“. Click on “Save” button in the top-right corner.

4. Assigning configured Admin REST Role to existing admin user

Ok, we configured everything to be able to use Magento REST services. Or not? Hey, we did everything to configure resources for Admin user type, but we didn’t assign any user to this roles.

Navigate to System->Permissions->Users. “Users” grid is shown with list of registered Magento site Administrators Click on some admin user from list in order to open “Edit user” screen. There is a tab named “REST role” on the left. Click on it and a list of Admin type roles is shown on the screen. Click on “Assigned” radio box near that role name. Save User. You have successfully assigned the admin user to be able to access REST resources on our Magento.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.