Fix: don't search channel library if rank < seeplaylist
This commit is contained in:
parent
bc3f20198c
commit
71114b0060
4 changed files with 23 additions and 3 deletions
18
www/js/ui.js
18
www/js/ui.js
|
|
@ -242,6 +242,15 @@ $("#newpollbtn").click(showPollMenu);
|
|||
|
||||
/* search controls */
|
||||
$("#library_search").click(function() {
|
||||
if (!hasPermission("seeplaylist")) {
|
||||
$("#searchcontrol .alert").remove();
|
||||
var al = makeAlert("Permission Denied",
|
||||
"This channel does not allow you to search its library",
|
||||
"alert-danger");
|
||||
al.find(".alert").insertAfter($("#library_query").parent());
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit("searchMedia", {
|
||||
source: "library",
|
||||
query: $("#library_query").val().toLowerCase()
|
||||
|
|
@ -250,6 +259,15 @@ $("#library_search").click(function() {
|
|||
|
||||
$("#library_query").keydown(function(ev) {
|
||||
if(ev.keyCode == 13) {
|
||||
if (!hasPermission("seeplaylist")) {
|
||||
$("#searchcontrol .alert").remove();
|
||||
var al = makeAlert("Permission Denied",
|
||||
"This channel does not allow you to search its library",
|
||||
"alert-danger");
|
||||
al.find(".alert").insertAfter($("#library_query").parent());
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit("searchMedia", {
|
||||
source: "library",
|
||||
query: $("#library_query").val().toLowerCase()
|
||||
|
|
|
|||
|
|
@ -914,6 +914,7 @@ function handlePermissionChange() {
|
|||
setVisible("#plmeta", hasPermission("seeplaylist"));
|
||||
$("#getplaylist").attr("disabled", !hasPermission("seeplaylist"));
|
||||
|
||||
setVisible("#showplaylistmanager", hasPermission("seeplaylist"));
|
||||
setVisible("#showmediaurl", hasPermission("playlistadd"));
|
||||
setVisible("#showcustomembed", hasPermission("playlistaddcustom"));
|
||||
$("#queue_next").attr("disabled", !hasPermission("playlistnext"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue