var acls = SUGAR.App.user.getAcls();And then navigate away and then back to Accounts module to force a re-render. The "Create" button at the top will disappear and if you navigate into an Account record you will find the "Copy" or "Duplicate" buttons no longer appear in action dropdown.
acls.Accounts.create = 'no';
SUGAR.App.user.set("acls", acls);
App Ecosystem @ SugarCRM
Hello Everyone,
This development is work for the Mobile App ?
Because I have check this code in to my development instance but in mobile-app that is not working.
Hello Everyone,
I got it working really well, as described by Gaelle.
I wonder if it is possible to set custom acls e.g. acls.Opportunities.customButton= 'no';
and to use it together with custom buttons/links e.g. /custum/modules/Opportunities/clients/base/record/record.php:
<?php $viewdefs['Opportunities'] = array ( 'base' => array ( 'view' => array ( 'record' => array ( 'buttons' => array ( 0 => array ( 'type' => 'button', 'name' => 'cancel_button', 'label' => 'LBL_CANCEL_BUTTON_LABEL', 'css_class' => 'btn-invisible btn-link', 'showOn' => 'edit', ), 1 => array ( 'type' => 'rowaction', 'event' => 'button:save_button:click', 'name' => 'save_button', 'label' => 'LBL_SAVE_BUTTON_LABEL', 'css_class' => 'btn btn-primary', 'showOn' => 'edit', 'acl_action' => 'edit', ), 2 => array ( 'type' => 'actiondropdown', 'name' => 'main_dropdown', 'primary' => true, 'showOn' => 'view', 'buttons' => array ( 0 => array ( 'type' => 'rowaction', 'event' => 'button:edit_button:click', 'name' => 'edit_button', 'label' => 'LBL_EDIT_BUTTON_LABEL', 'acl_action' => 'edit', ), 1 => array ( 'type' => 'rowaction', 'event' => 'button:create_platformaccount:click', 'name' => 'create_platformaccount', 'css_class' => 'create_platformaccount', 'label' => 'LBL_CONVERT_BUTTON_LABEL', 'acl_action' => 'customButton', ), ...
What do you think?
Hello Everyone,
I got it working really well, as described by Gaelle.
I wonder if it is possible to set custom acls e.g. acls.Opportunities.customButton= 'no';
and to use it together with custom buttons/links e.g. /custum/modules/Opportunities/clients/base/record/record.php:
<?php $viewdefs['Opportunities'] = array ( 'base' => array ( 'view' => array ( 'record' => array ( 'buttons' => array ( 0 => array ( 'type' => 'button', 'name' => 'cancel_button', 'label' => 'LBL_CANCEL_BUTTON_LABEL', 'css_class' => 'btn-invisible btn-link', 'showOn' => 'edit', ), 1 => array ( 'type' => 'rowaction', 'event' => 'button:save_button:click', 'name' => 'save_button', 'label' => 'LBL_SAVE_BUTTON_LABEL', 'css_class' => 'btn btn-primary', 'showOn' => 'edit', 'acl_action' => 'edit', ), 2 => array ( 'type' => 'actiondropdown', 'name' => 'main_dropdown', 'primary' => true, 'showOn' => 'view', 'buttons' => array ( 0 => array ( 'type' => 'rowaction', 'event' => 'button:edit_button:click', 'name' => 'edit_button', 'label' => 'LBL_EDIT_BUTTON_LABEL', 'acl_action' => 'edit', ), 1 => array ( 'type' => 'rowaction', 'event' => 'button:create_platformaccount:click', 'name' => 'create_platformaccount', 'css_class' => 'create_platformaccount', 'label' => 'LBL_CONVERT_BUTTON_LABEL', 'acl_action' => 'customButton', ), ...
What do you think?
Just answering my own question above. After some tests, it seems to work.