on 01-28-2016 8:17 AM
Hello ,
You could override the DefaultProductSearchBrowserModel:
<alias alias="DefaultProductSearchBrowserModel" name="sampleProductSearchBrowserModel"/>
<bean id="sampleProductSearchBrowserModel" class="sample.extension.sampleProductSearchBrowserModel"
scope="prototype" parent="AbstractPageableBrowserModel">
</bean>
and then the method (for example):
public boolean isShowCreateButton()
{
if (userService.isAdmin(userService.getCurrentUser())) //optional if
return true;
return false;
}
If you want to leave this button active for the admin - use the optional if. Else just return false
Hope it helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Janhavi,
With the corresponding configuration of Access Rights you can restrict particular users/usergroups from item creation. It won't make (+) button disabled but it won't allow a user to create an item as shown in the image below
If you really want to customize the (+) button rendering than you can start with overriding
de.hybris.platform.cockpit.components.contentbrowser.DefaultSearchContentBrowser.createCreateNewComponent()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I have 2 “+” create new Item button, I want to keep the one that I’ve customized (the items that will be created extends Product) and to disable the other one, what shall I do? I don’t need it for any user/usergroup. I’ve tried in the access rights impex, but if I restrict create Product, both are disabled.
Thank you!
Hi
I suppose the easiest way would be to remove this button which can be done through yourbackofficeextension-backoffice-config.xml
like follows
<context merge-by="principal" type="YourType" component="listviewactions" principal="YourRole">
<y:actions>
<y:group qualifier="common">
<y:action action-id="com.hybris.cockpitng.action.create" merge-mode="REMOVE" />
</y:group>
</y:actions>
</context>
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.