|
@@ -664,10 +664,6 @@ class CRUDController extends Controller
|
|
*/
|
|
*/
|
|
public function historyAction($id = null)
|
|
public function historyAction($id = null)
|
|
{
|
|
{
|
|
- if (false === $this->admin->isGranted('EDIT')) {
|
|
|
|
- throw new AccessDeniedException();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
$id = $this->get('request')->get($this->admin->getIdParameter());
|
|
$id = $this->get('request')->get($this->admin->getIdParameter());
|
|
|
|
|
|
$object = $this->admin->getObject($id);
|
|
$object = $this->admin->getObject($id);
|
|
@@ -676,6 +672,10 @@ class CRUDController extends Controller
|
|
throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
|
|
throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (false === $this->admin->isGranted('EDIT', $object)) {
|
|
|
|
+ throw new AccessDeniedException();
|
|
|
|
+ }
|
|
|
|
+
|
|
$manager = $this->get('sonata.admin.audit.manager');
|
|
$manager = $this->get('sonata.admin.audit.manager');
|
|
|
|
|
|
if (!$manager->hasReader($this->admin->getClass())) {
|
|
if (!$manager->hasReader($this->admin->getClass())) {
|
|
@@ -706,10 +706,6 @@ class CRUDController extends Controller
|
|
*/
|
|
*/
|
|
public function historyViewRevisionAction($id = null, $revision = null)
|
|
public function historyViewRevisionAction($id = null, $revision = null)
|
|
{
|
|
{
|
|
- if (false === $this->admin->isGranted('EDIT')) {
|
|
|
|
- throw new AccessDeniedException();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
$id = $this->get('request')->get($this->admin->getIdParameter());
|
|
$id = $this->get('request')->get($this->admin->getIdParameter());
|
|
|
|
|
|
$object = $this->admin->getObject($id);
|
|
$object = $this->admin->getObject($id);
|
|
@@ -718,6 +714,10 @@ class CRUDController extends Controller
|
|
throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
|
|
throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (false === $this->admin->isGranted('EDIT', $object)) {
|
|
|
|
+ throw new AccessDeniedException();
|
|
|
|
+ }
|
|
|
|
+
|
|
$manager = $this->get('sonata.admin.audit.manager');
|
|
$manager = $this->get('sonata.admin.audit.manager');
|
|
|
|
|
|
if (!$manager->hasReader($this->admin->getClass())) {
|
|
if (!$manager->hasReader($this->admin->getClass())) {
|