* [perf story #49799] Add checkLibPriv js function.

This commit is contained in:
wangyidong
2024-08-12 12:36:00 +08:00
committed by 孙广明
parent 7859c7f653
commit fbdf8112a4
+20 -2
View File
@@ -241,7 +241,7 @@ window.loadLibModules = function(e)
window.toggleWhiteList = function(e)
{
const acl = e.target.value;
$('#whitelistBox').toggleClass('hidden', acl == 'open');
$('#whiteListBox').toggleClass('hidden', acl == 'open');
}
$(document).on('mousedown', '.ajaxCollect', function (event)
@@ -300,7 +300,7 @@ window.checkObjectPriv = function(e)
$whiteListBox = $('#whiteListBox');
if($whiteListBox.length == 0 || $whiteListBox.hasClass('hidden')) return;
let $users = $('[name^=users]');
let $users = $('#whiteListBox [name^=users]');
let users = $users.val();
if(users.length == 0) return;
@@ -330,3 +330,21 @@ window.checkObjectPriv = function(e)
$inputGroupBox.append("<div class='notice pt-1'>" + data + '</div>');
});
}
window.checkLibPriv = function(e)
{
$whiteListBox = $('#whiteListBox');
if($whiteListBox.length == 0 || $whiteListBox.hasClass('hidden')) return;
let $users = $('#whiteListBox [name^=users]');
let users = $users.val();
if(users.length == 0) return;
let formData = new FormData();
let libID = $('[name=lib]').val();
users.forEach(function(user){ formData.append('users[]', user); });
$.post($.createLink('doc', 'ajaxCheckLibPriv', 'libID=' + libID), formData, function(data)
{
});
}