Disallow/Allow Publish button

Hi. Please, help me to create “Disallow/Allow Publish” button for all participants who joined a session as listeners.
I tried the next code
//some code to create jQuery button
//now function to trigger Disallow Publish
function disallowPublish(event)
{
//This will update room participant list on click and how updated list in dropdown.
participantsNames = {};
var listParticipantsRequest = {
“request”: “listparticipants”,
room: myRoom
};
publisherPluginHandle.send(
{
message: listParticipantsRequest,
success: function(result)
{
if(result[‘videoroom’] === ‘participants’)
{
for(p in result[‘participants’])
participantsNames[result[‘participants’][p][‘id’]]=result[‘participants’][p][‘display’];
}}
});

var disallowPublish1={
request: “allowed”,
secret: myRoomSecret,
room: myRoom,
action: “disable”,
allowed:
};

publisherPluginHandle.send(
{
message: disallowPublish1
});

$('#allow-publish').removeAttr('disabled').html('<i class="fas fa-ban"></i> Allow Publish').one('click', allowPublish);
$('#allow-publish').removeClass('btn-success');
$('#allow-publish').addClass('btn-danger');

}

It doesn’t work. Publishing still allowed.