Disallow/Allow Publish button

Hi. I want to create “Disallow/Allow Publish” button for all participants who joined a session as listeners.
//some jQuery code to create the button
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');

}

This code doesn’t work. Participants can publish their videos. What is wrong?