With geography-based user access, you can specify which country data a user has access to and prevent them from viewing customers, orders, or returns outside of their jurisdiction. The user will not be able to edit these records nor enter shipping addresses for countries they don't have access to when creating new orders.
By default, all users will have access to data for all countries. However, you can use a set of custom user roles to limit the countries someone has access to in their user settings.
Admin and Super Admin user roles cannot be restricted by country. These users will always have access to information from all countries.
Country Access Roles
Each role grants an Admin user permission to operate within that country. This means that a user with the "Germany" and "France" roles will be able to access customer and order data from Germany and France, but not Spain.
Country roles are displayed at System > Permissions > Access. If none are available, then you will have to create the roles you need.
Create Country Access
To generate a country access role:
- Click Create Country Access in the top right.
- Select the country or countries you need a role for. Note that you can filter the list to more quickly find the option you're looking for.
- Click Save.
Once created, you cannot edit or delete the access role. You will also not be able to create duplicate roles for any countries that already have an existing role, as those options will be greyed out in the Create Country Access list.
Apply Access Roles to Users
When adding a new user or editing an existing one, the Country Access column is displayed next to the column of other user roles. Select the country or countries that the user should have access to. If no specific countries are selected, then the user will have access to all countries by default.
Note that you can also search for countries in the column's search bar to more quickly find the country you're looking for.
User Access Restrictions
Restricting access to a particular country affects which customers (including B2B accounts) and orders the user can view. If all of the shipping addresses in an account or order belong to a country that the user doesn't have access to, then that account or order will not be visible from the Admin UI or API and the user won't be able to find them in search results.
However, if at least one shipping address is in a valid country then the user will have access to the account or order. In some cases, such as offline orders, there may only be one shipping address on the order which will solely determine the user's access. This is irrespective of the billing address location.
For example, when a user only has the France role:
- If a customer only has a shipping address in Spain, then the user will not be able to view or manage the customer.
- If a customer has one shipping address in Spain and one in France, then the user will be able to view and manage the customer.
- If an order has a shipping address in France, then the user will be able to view and manage the order (even if the billing address is in Germany).
- If an order has a shipping address in Germany, then the user will not be able to view or manage the order (even if the billing address is in France).
- Note that if a user has access to an order but not the customer's account, then the account name will not be displayed on that order. The option to change their addresses will also be greyed out.
Returns are determined based on the order access. If a user doesn't have access to an order, then they will not have any access to returns associated with that order.
Shipping Address Restrictions
When adding a new shipping address to any order, customer, subscription, or B2B account through the Admin UI or API, the user can only add a shipping address for the country they have access to. If they select an invalid country, the shipping options will be reset to the defaults and greyed out as non-interactable.
When an existing editing shipment address, the user can only select a country that they have access to. If they try to select an invalid country, an error will be displayed instead.
Order Creation Restrictions
The user cannot create orders with a shipping address to a country that they don't have access to through either the Admin UI or API. Invalid addresses will be hidden from the address selection list and the user will not be able to add any new addresses belonging to a country outside their jurisdiction. If they attempt to select an invalid country, the shipping options will be reset to the defaults and greyed out as non-interactable.
Only the shipping address is restricted. The user can successfully create an order with a billing address located in any country.