how to prevent to edit columns where is not in our list ?
- Single Page
Posted 28 January 2013 - 18:38 PM
I have a list that I limited by [b]where [/b]function in grocerycrud and all things is ok and it limits results. but in edit I can change the column id in url and edit that columns which is not in the list and I don't want to edit that columns , how can i solve this problem ?
in addition, the delete have the same problem.
best regards
Ali
Posted 28 January 2013 - 19:38 PM
Posted 28 January 2013 - 19:51 PM
here is my code
$output = $crud->render();
$state = $crud->getState();
$state_info = $crud->getStateInfo();
if ($state=='edit' || $state=='delete')
{
$id = $state_info->primary_key;
if ($this->BlogCategoryModel->getOwner($id)==$this->user_id)
$this->_example_output($output);
else
{
$this->oi->add_error('Some ERROR Message');
$this->load->view('main');
}
}
else
{
$this->_example_output($output);
}