Skip to content

Commit

Permalink
raise permission denied for playlist not visible
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitloup committed May 4, 2020
1 parent a4245d9 commit 6590aa0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pod/video/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,13 @@ def render_video(request, id, slug_c=None, slug_t=None, slug_private=None,
playlist = get_object_or_404(
Playlist,
slug=request.GET['playlist']) if request.GET.get('playlist') else None
if playlist and request.user != playlist.owner and not playlist.visible:
# not (request.user.is_superuser or request.user.has_perm(
# "video.change_theme")
messages.add_message(
request, messages.ERROR,
_('You don\'t have access to this playlist.'))
raise PermissionDenied

is_password_protected = (
video.password is not None and video.password != '')
Expand Down

0 comments on commit 6590aa0

Please sign in to comment.