Fix document controller
Avoid multiple permission query on same object