unsetOperations

unsetOperations(void)

The method unsetOperations is removing completely any of the operations for the end-user.

The syntax is simple. You can find an example below:

$crud->unsetOperations();

The above line is exactly the same as:

$crud->unsetAdd();
$crud->unsetClone();
$crud->unsetEdit();
$crud->unsetRead();
$crud->unsetDelete();

More specifically the unsetOperations:

  1. is removing the button "Add", "Edit", "View" and "Delete"
  2. is removing any operation that has to do with the 'Add', 'Edit', 'Read' and 'Delete'
  3. The user doesn't have the ability to do any operation of add, edit or delete even if they try to do it by having the URL of the API (e.g. the permission is not allowed)

You can also see a full working example:

$crud->setTable('customers');
$crud->setSubject('Customer', 'Customers');
$crud->columns(['customerName','phone','addressLine1','creditLimit']);
$crud->unsetOperations();

$output = $crud->render();

You can see the results of the above example here. As you can see by your own the end-user can only see the datagrid and have the ability to print or export. Rather than that any other operation is not allowed to the user