How can I restrict bulk delete and import from list view in SuiteCRM

HI ,
To each module in the list view if we select some records from list view ,there is a BULK ACTION like shown below.
bulkdelete

how can restrict this option(PRINT AS PDF ,EXPORT,DELTE ) to some of USERS ,I means I have 4 user ,for 3 I am trying to disable this options but from where I have to do and for one user it should be enable .
This BULK ACTION is showing to all modules in the list view.

How can I do this ,can any one help on it plz.

Thanks
Sandeep

Sandeep,
You need to create a new role and assign all of users you want to hide bulk operation like Delete.

Rest hiding other links are not managble ( like merge , add to target list or print as pdf ).
You may need to write some javascript code for hiding them.
Code can be placed on modules/mod_name/view.list.php.

HI @ashish,Thanks for you response ,
I have created that roles earlier only like shown below.

May I know how can I retrict this option which is showing in BULK ACTION.
Note: For one user it should be show ,rest of them I have to disable ,how can I do this .

You can hide all available options only. Rest you need to put some javascript at view.list.php ( as stated above ). if you don’t want to code , take a look here.

@muralasandeep123

You should use different methods for buttons.

  1. for Export - create 2 different roles for user which users should have access to the button or not.
  2. for Delete and Print...:
  • create the file custom/modules/Contacts/views/view.list.php based on the file modules/Contacts/views/view.list.php
  • the code for Print... you can see into the file modules/Contacts/views/view.list.php
  • the code for Delete you can see into the post: ListView: How to remove delete bulk action?
  • add the condition: if (ACLController::checkAccess('Contacts', 'export', true)) , if the user has access for export it will have access to other buttons

As a more diffult variant you can add custom collumns to role module, look at the file: modules/ACLActions/actiondefs.override.php

@ashish I went through your link which you are provided ,
I am using suitecrm version 7.11 ,I haven’t seen any Global Hide Manager option in my admin section .
How can i find that Global Hide Manager option ,I am new to this CRM.

@p.konetskiy thanks for response ,I have checked modules/Contacts/views/view.list.php there is no code related to print and I have check that link which your shared but custom/include/ there is no folder calles MVC/VIEW.... ,
Could you explain little bit more I am new to this programming ,that will help for me .

thanks
Sandeep

@muralasandeep123
It is present:

<?php

require_once('modules/Contacts/ContactsListViewSmarty.php');

class ContactsViewList extends ViewList
{
    /**
     * @see ViewList::preDisplay()
     */
    public function preDisplay()
    {
        require_once('modules/AOS_PDF_Templates/formLetter.php');
// insert the button Print...
        formLetter::LVPopupHtml('Contacts');
        parent::preDisplay();

        $this->lv = new ContactsListViewSmarty();
    }
}

The code call the function which created the button.

@p.konetskiy,Yes this code only there in view_list.php ,May i know where I have to change ,Sorry to asking again I am new to this concept and coding ,plz help me on it .
Thanks

@muralasandeep123

I think that it should be code in the file custom/modules/Contacts/views/view.list.php like this:

<?php

require_once('modules/Contacts/ContactsListViewSmarty.php');

class CustomContactsViewList extends ViewList
{
    /**
     * @see ViewList::preDisplay()
     */
    public function preDisplay()
    {
        if (ACLController::checkAccess('Contacts', 'export', true)){
            require_once('modules/AOS_PDF_Templates/formLetter.php');
            formLetter::LVPopupHtml('Contacts');
        }
        if (ACLController::checkAccess('Contacts', 'export', true)){
            $this->lv = new ContactsListViewSmarty();
        }else {
            parent::preDisplay();
            $this->lv->delete = false;
        }
    }
}

@p.konetskiy,thanks for your response and valuable time ,

I have added this code at custom/modules/Contacts/views/view.list.php but no result still that delete option is showing .

@muralasandeep123

The code work. I tested it.
Did you create two type of roles? And you should remember that the roles doesn’t work for admin user.

@p.konetskiy,
Sorry, to me still that delete is showing at BULK ACTION dropdown,I have created roles and I have done ``repair``` also ,
I did not understand where I have done the mistaks.

@p.konetskiy and @ashish
I have created Roles shown like below ,

In My Role Export and import I have given NONE but to that User still that import option is showing (when open any module at left side bar ).
May I know how can I solve this Isssue also.

@muralasandeep123

  1. Did you do relogin for the user?
  2. Try: Admin->Repair->Repair Roles

@p.konetskiy,thanks for your valuable time and information,

Yes I have done reloging and Admin->Repair->Repair Roles also .
when I open role managment to that particuler USER every thing is showing correct which I share that image

But there is one option called List Role By User like shown below.

Here If I select that User from the dropdown ,It is showing wrong Roles like shown below .

I did not understand why it is showing ,could you plz help on it .
Did I do wrong anything .

Thanks
Sandeep

@muralasandeep123
Check roles in form View Users. I recommend setting only one role.

@p.konetskiy thank you so much for your information and time,

It’s so appreciated.
It is done