From 00dc078311a5b86c520ed5c7096052bbc7961c1d Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 1 Mar 2016 13:50:55 +0100 Subject: [PATCH] feat(playlist): render playlists if playlist id is invalid close #4209 --- pkg/api/playlist.go | 5 +++++ public/app/features/playlist/playlist_routes.js | 3 +++ 2 files changed, 8 insertions(+) diff --git a/pkg/api/playlist.go b/pkg/api/playlist.go index abc092b8021..7aa3c7d0057 100644 --- a/pkg/api/playlist.go +++ b/pkg/api/playlist.go @@ -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 diff --git a/public/app/features/playlist/playlist_routes.js b/public/app/features/playlist/playlist_routes.js index e61ed2d6527..646fd55ff4b 100644 --- a/public/app/features/playlist/playlist_routes.js +++ b/public/app/features/playlist/playlist_routes.js @@ -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;