|
@@ -16,7 +16,7 @@ class EditController extends Controller
|
16
|
16
|
return $this->jsonResponseError($uncondition);
|
17
|
17
|
|
18
|
18
|
$playlist_manager = $this->getPlaylistManager();
|
19
|
|
- if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())) || !$request->get('elements'))
|
|
19
|
+ if (!$this->tokenIsCorrect() || !($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())) || !$request->get('elements'))
|
20
|
20
|
return $this->jsonNotFoundResponse();
|
21
|
21
|
|
22
|
22
|
$playlist_manager->updatePlaylistElementsOrder($playlist, $request->get('elements'));
|
|
@@ -30,7 +30,7 @@ class EditController extends Controller
|
30
|
30
|
return $this->jsonResponseError($uncondition);
|
31
|
31
|
|
32
|
32
|
$playlist_manager = $this->getPlaylistManager();
|
33
|
|
- if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
|
|
33
|
+ if (!$this->tokenIsCorrect() || !($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
|
34
|
34
|
return $this->jsonNotFoundResponse();
|
35
|
35
|
|
36
|
36
|
$playlist_manager->removePlaylistElementWithId($playlist, $element_id);
|
|
@@ -44,7 +44,7 @@ class EditController extends Controller
|
44
|
44
|
return $this->jsonResponseError($uncondition);
|
45
|
45
|
|
46
|
46
|
$playlist_manager = $this->getPlaylistManager();
|
47
|
|
- if (!($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser()))
|
|
47
|
+ if (!$this->tokenIsCorrect() || !($playlist = $playlist_manager->findOwnedPlaylistWithId($playlist_id, $this->getUser()))
|
48
|
48
|
|| !($element = $this->getElementWithId($element_id)))
|
49
|
49
|
return $this->jsonNotFoundResponse();
|
50
|
50
|
|
|
@@ -83,7 +83,7 @@ class EditController extends Controller
|
83
|
83
|
if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_COPY)) !== false)
|
84
|
84
|
return $this->jsonResponseError($uncondition);
|
85
|
85
|
|
86
|
|
- if (!($element = $this->getElementWithId($element_id)))
|
|
86
|
+ if (!$this->tokenIsCorrect() || !($element = $this->getElementWithId($element_id)))
|
87
|
87
|
return $this->jsonNotFoundResponse();
|
88
|
88
|
|
89
|
89
|
if (!($playlist = $this->getPlaylistManager()->findOneAccessiblePlaylistWithId($playlist_id, $this->getUser())))
|
|
@@ -102,7 +102,7 @@ class EditController extends Controller
|
102
|
102
|
if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_DELETE)) !== false)
|
103
|
103
|
throw $this->createNotFoundException();
|
104
|
104
|
|
105
|
|
- if (!($playlist = $this->getPlaylistManager()->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
|
|
105
|
+ if (!$this->tokenIsCorrect() || !($playlist = $this->getPlaylistManager()->findOwnedPlaylistWithId($playlist_id, $this->getUser())))
|
106
|
106
|
throw $this->createNotFoundException();
|
107
|
107
|
|
108
|
108
|
$this->getPlaylistManager()->deletePlaylist($playlist);
|
|
@@ -118,7 +118,7 @@ class EditController extends Controller
|
118
|
118
|
|
119
|
119
|
$playlist_manager = $this->getPlaylistManager();
|
120
|
120
|
|
121
|
|
- if (!($playlist = $playlist_manager->findPlaylistWithId($playlist_id, $this->getUser())))
|
|
121
|
+ if (!$this->tokenIsCorrect() || !($playlist = $playlist_manager->findPlaylistWithId($playlist_id, $this->getUser())))
|
122
|
122
|
throw $this->createNotFoundException();
|
123
|
123
|
|
124
|
124
|
$playlist_manager->removePickedPlaylistToUser($this->getUser(), $playlist);
|
|
@@ -132,7 +132,7 @@ class EditController extends Controller
|
132
|
132
|
if (($uncondition = $this->userHaveNonConditionToMakeAction(SecurityContext::ACTION_PLAYLIST_PICK)) !== false)
|
133
|
133
|
return $this->jsonResponseError($uncondition);
|
134
|
134
|
|
135
|
|
- if (!($playlist = $this->getPlaylistManager()->findOneAccessiblePlaylistWithId($playlist_id)))
|
|
135
|
+ if (!$this->tokenIsCorrect() || !($playlist = $this->getPlaylistManager()->findOneAccessiblePlaylistWithId($playlist_id)))
|
136
|
136
|
return $this->jsonNotFoundResponse();
|
137
|
137
|
|
138
|
138
|
$this->getPlaylistManager()->addPickedPlaylistToUser($this->getUser(), $playlist);
|