Business roles and restricting access for widgets in Backoffice

In SAP Commerce(Hybris) Backoffice we can restrict access to the application to certain data, functionality and configuration settings. This means that we can design a Backoffice application that shows a different application mash-up to different business users, depending on their business role.

A Backoffice Role is an extension of UserGroup which is meant to be used for restricting access in Backoffice (i.e. UI configuration context defines an dimension called principal which actually work exactly on BackofficeRoles). We cannot use simple UserGroup — it will not be respected by Backoffice.

Here are the steps below for adding restriction:

Create custom backoffice extension

We create our own backoffice extension by using “ybackoffice” template and add this to our localextensions.xml. This backoffice webapplication contains new modules,widgets and UI components. By using custom backoffice extenstion we can create our own implementation.

  1. We create a UserGroup by selecting Backoffice Role:

Change backoffice login disabled to false in administration tab.

2. We create a new Employee or use an existing one and assign it the user group we created above.

3. To restrict access to specific tree node — (Product in our example) for the role in explorer tree we should add this in <ourextension>-backoffice-config.xml — in newly created extension(above).

In principal we define the role — “portaladminborole” in our example.

After login with the employee which we assigned the role we can see the result.

We can also want to restrict access to certain data types, we can do this in Backoffice Permission Management and give/remove “read”, “change”, “create”, “remove” access.

Customizing section for Product in backoffice

Let’s say we want to add new fields in the essentials and description sections of the Product’s editor area in the Backoffice. Here is how we can do this:

With <editArea:essenstialSections tag we can specify which fields to be displayed in “Essential” tab and with <editorArea:tab name”” tag we specify the tab and with <editorArea:section name”” tag we specify the section the field will be shown.

position” attribute is used to specify the position of the attribute in the section.

How we can add new field in Backoffice list view?

We can do it using <list-vie:list-view> tag again in <ourextension>-backoffice-config.xml.

More you can learn here:

Make sure you give this post a clap and follow my blog if you find it helpful.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store