File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,13 @@ public function indexAction(Request $request)
6969 throw new NotFoundHttpException ();
7070 }
7171
72+ if ($ this ->getSnapshotVisibility ($ page ) != PageInterface::VISIBILITY_PUBLIC ) {
73+
74+ if (false === $ this ->get ('security.context ' )->isGranted ('ROLE_USER ' )) {
75+ throw new AccessDeniedException ();
76+ }
77+ }
78+
7279 $ updatedAt = $ phpCache ->get (sprintf ('page_%s_created_at ' , $ page ->getId ()));
7380 $ cacheKey = $ request ->getLocale ().$ request ->getPathInfo ();
7481
@@ -442,6 +449,17 @@ public function getPageHelper()
442449 return $ this ->container ->get ('networking_init_cms.helper.page_helper ' );
443450 }
444451
452+ /**
453+ * @param PageSnapshotInterface $page
454+ * @return mixed
455+ */
456+ public function getSnapshotVisibility (PageSnapshotInterface $ page ){
457+
458+ $ jsonObject = json_decode ($ page ->getVersionedData ());
459+
460+ return $ jsonObject ->visibility ;
461+ }
462+
445463 /**
446464 * @param PageSnapshotInterface $page
447465 * @return bool
You can’t perform that action at this time.
0 commit comments