I would like to know the basic idea guideline.
I am managing entity by SonataAdminBundle for now and get used to it. I would like to make progress step forward.
I want to make both admin and user edit the entity by sonataadminbundle
[For example]
I have table/entity like this.
Id |User | data
1 |bear | sarmon
2 |dog | meat
3 |monkey| banana
4 |bear | peanuts
5 |dog | corn
Of course I(admin) can edit entity from admin_dashboard of SonataAdminBundle.
However I want to let user 'bear' edit only 1 and 4 rows.
If I make edit/update/list script from the scratch in Controller. It is easy to accomplish.
However, I think it is like useless work because SonataAdminBundle has better UI than I make from scratch.
So, Does anyone know the appropriate way for this kind of ideas?? or it is bad idea to use SonataAdminBundle for both user and admin??
I want let user bear see only bear related tables like.
Id |User | data
1 |bear | sarmon
4 |bear | peanuts
At first I am struggling with
public function configureListFields(ListMapper $listMapper)
however this code is only called one time.
I can't find the right answer.
So I guess I need to put this kind of code somewhere else.
if ($user == bear){
array_push($table,$line);
}
else {
}