I am trying to populate the collection-browser in my custom Backoffice extension based on the user group of the current user. I have a custom type that I want to dispaly. Below is an example which replicates my situation as I am using a parent type in this case "CustomTask" which has two subytpes - "ATask" and "BTask"
I have three usergroups whose users should only see certain types of tasks.
- "myAdminGroup" users should see all types of tasks as it's defined with the parent type
- "customGroupA" users should only see "ATask" items listed
- "customGroupB" users should only see "BTask" items listed
The problem I am facing is that no matter what type of user logs in the collection-browser is always being populated and showing all types. My assumption was that the user would only see the type of items that were configured for each component and specified principal. This does not seem to be the case.
Is there anything I'm missing here, OR is this not technically possible? Any other suggestions to accomplish this would be appreciated!
Below is a snippet of code that I am using to replicates my situation. Parent type -> "CustomTask" has two subtypes -> "ATask" and "BTask"
<context type="CustomTask" parent="GenericItem" component="mycustombackoffice-collection-browser" principal="myAdminGroup">
<cb:collection-browser xmlns:cb="http://www.hybris.com/cockpitng/config/collectionbrowser">
<cb:available-molds default-mold="list-view">
<cb:mold spring-bean="listViewCollectionBrowserMoldStrategy"/>
</cb:available-molds>
</cb:collection-browser>
</context>
<context type="ATask" component="mycustombackoffice-collection-browser" principal="customAGroup">
<cb:collection-browser xmlns:cb="http://www.hybris.com/cockpitng/config/collectionbrowser">
<cb:available-molds default-mold="list-view">
<cb:mold spring-bean="listViewCollectionBrowserMoldStrategy"/>
</cb:available-molds>
</cb:collection-browser>
</context>
<context type="BTask" component="mycustombackoffice-collection-browser" principal="customBGroup">
<cb:collection-browser xmlns:cb="http://www.hybris.com/cockpitng/config/collectionbrowser">
<cb:available-molds default-mold="list-view">
<cb:mold spring-bean="listViewCollectionBrowserMoldStrategy"/>
</cb:available-molds>
</cb:collection-browser>
</context>