User Playlist Option

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

User Playlist Option

Postby burner247 » Wed Jan 11, 2012 8:39 pm

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.
burner247
 
Posts: 16
Joined: Sun Nov 21, 2010 1:29 am

Re: User Playlist Option

Postby ytechie » Wed Jan 11, 2012 8:47 pm

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}.
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: User Playlist Option

Postby burner247 » Fri Jan 13, 2012 2:26 am

Thanks for the rapid response!
burner247
 
Posts: 16
Joined: Sun Nov 21, 2010 1:29 am

Re: User Playlist Option

Postby ytechie » Fri Jan 13, 2012 2:28 am

No problem! Hope it helped! :D
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 23 guests