I have question about security for editing/deleting data in a table.
For example, I have table with name [b]my_files[/b] with field:
id user_id my_file
1 100 abc
2 100 def
3 105 cde
when user logged in as userid 100, I can simply display filtered data my_files table to user with code,:
function myfunction(){
.......
$crud->set_table('my_files');
$crud->where('user_id',$this->session->userdata("loginuserid"));
......
}
Unfortunately $crud->where only work for list, not for update/delete
When it is about update/delete record, other user still can see/update/delete others user data.
For example, when I logged in with user_id: 105, I can edit/delete data in table my_files for id 1 (owned by user 100) by accessing url:
www.mydomain...../memberarea/myfunction/edit/1 or www.mydomain...../memberarea/myfunction/delete/1
Is there any simillar features like $crud->where command that I can use for securing edit/delete data
eg. $crud->where_delete('user_id',$this->session->userdata("loginuserid"));
so when url www.mydomain...../memberarea/myfunction/delete/1 called, it will execute
delete from 'my_files' where `id`='1' and `user_id`='105'
instead of
delete from 'my_files' where `id`='1'
Also for updating record, it will not show the edit form when additional where condition not meet.
any idea?