feat(playlist): render playlists if playlist id is invalid

close #4209
This commit is contained in:
bergquist 2016-03-01 13:50:55 +01:00
parent 62b21c586d
commit 00dc078311
2 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,11 @@ func ValidateOrgPlaylist(c *middleware.Context) {
return
}
if query.Result.OrgId == 0 {
c.JsonApiErr(404, "Playlist not found", err)
return
}
if query.Result.OrgId != c.OrgId {
c.JsonApiErr(403, "You are not allowed to edit/view playlist", nil)
return

View File

@ -26,6 +26,9 @@ function (angular) {
controller : 'PlaylistEditCtrl'
})
.when('/playlists/play/:id', {
templateUrl: 'public/app/features/playlist/partials/playlists.html',
controllerAs: 'ctrl',
controller : 'PlaylistsCtrl',
resolve: {
init: function(playlistSrv, $route) {
var playlistId = $route.current.params.id;