To add the delegated administration feature to your storefront pages, you must modify the Profile Layout. Specifically, the Profile Layout has access to two widgets that provide delegated administration features:
The Account Contacts widget provides the delegated administrator with an interface for viewing, adding, removing, and modifying account contacts. Using this widget, the delegated administrator can also activate a contact as well as give administrator privileges to a contact. Note that a delegated administrator cannot remove the administrator role from her own profile; however, she can remove the administrator role from another contact. Similarly, a delegated administrator cannot deactivate herself but she can deactivate other delegated administrators.
The Account Addresses widget allows a delegated administrator to specify account-level addresses. This widget also allows a delegated administrator to specify a default billing address and a default shipping address for the account.
To add these widgets to the Profile Layout, you must create a version of the Profile Layout for account-based shoppers only. To do this, go to the Design page, clone the Profile Layout, give it a descriptive name, enable the ‘Display layout to account shoppers only’ option, and save the clone.
To add the delegated administration widgets to the clone you created, you can create a vertical tab stack and place the widgets on individual tabs within the stack. To restrict the display of the delegated administration tabs to contacts that have administrator privileges, you can add something similar to the following code snippet in the vertical tab stack’s template (this snippet assumes you used “My Profile”, “Account Addresses”, and “Account Contacts” as the display names for the tabs that hold the Customer Profile, Account Contacts, and Account Addresses widgets, respectively):
($data.displayName() == 'My Profile') || ((($data.displayName() == 'Account Contacts') || ($data.displayName() == 'Account Addresses')) && ($masterViewModel.data.global.user.roles[0].function === 'admin'))
This code snippet shows the My Profile tab to all contacts but restricts the display of the Account Contacts and Account Addresses tabs to contacts with administrator privileges.
For more information on vertical tab stacks, see Add Vertical Tabs in the Using Oracle Commerce Cloud guide and Use Stacks for Increased Widget Layout Control in the Developing Widgets guide.