Page 1 of 1

User Playlist Option

PostPosted: Wed Jan 11, 2012 8:39 pm
by burner247
Is it possible to separate the create and delete playlist option so that users can create but not delete playlist? Or is possible that only creators of the playlist or administrators can see that playlist. Right now anyone with access to create/delete playlist can see all the available playlist.

Re: User Playlist Option

PostPosted: Wed Jan 11, 2012 8:47 pm
by ytechie
Here is how to prevent regular users from seeing the delete playlist link.

We are going to edit the loadPlaylist.jsp file, found at Subsonic/jetty/[build]/webapp/WEB-INF/jsp/loadPlaylist.jsp.

Here is the portion of code we are going to edit:

Code: Select all
<c:choose>
                            <c:when test="${model.load}">
                                <div class="forward"><a href="${loadUrl}"><fmt:message key="playlist.load.load"/></a></div>
                                <c:if test="${model.user.downloadRole}">
                                    <div class="forward"><a href="${downloadUrl}"><fmt:message key="common.download"/></a></div>
                                </c:if>
                                <c:if test="${model.user.playlistRole}">
                                    <div class="forward"><a href="javascript:deletePlaylist('${deleteUrl}')"><fmt:message key="playlist.load.delete"/></a></div>
                                </c:if>
                            </c:when>
                            <c:otherwise>
                                <c:if test="${model.user.playlistRole}">
                                    <div class="forward"><a href="${appendUrl}"><fmt:message key="playlist.load.append"/></a></div>
                                </c:if>
                            </c:otherwise>
                        </c:choose>


Edit the test for the deletePlaylist link to ${model.user.adminRole}.

Re: User Playlist Option

PostPosted: Fri Jan 13, 2012 2:26 am
by burner247
Thanks for the rapid response!

Re: User Playlist Option

PostPosted: Fri Jan 13, 2012 2:28 am
by ytechie
No problem! Hope it helped! :D