Hello. Please tell me what could be the problem. The code should be used to verify that the user belongs to a particular group. It works out correctly, but the re-election of the “Chairman” / “Presiding”, the check does not occur. Those. I need to ban all groups except for certain ones (set in a separate request) - choose "coffee break" and "drinking water". If I select at the very beginning of the user, the script will work, but if I re-select the user, then the user’s checking for group membership does not happen again, but the old group remains. Unfortunately, I am not a developer or even a junior, because I have a problem with understanding this bug. The source code is attached.
https://cloud.mail.ru/public/KocM/jRnCCMU72
I tried to refine the replay of the ajax request, but unfortunately the script did not re-work again. In fact, there are two solutions:
At each choice (or during critical switching, for example, the "participant" was selected, and the choice switches to "organizer", which has more access) to reload the page. === A fairly simple option from the development point of view, but many page reloads (the user's attention gets lost, they need to wait longer);
With each selection, an AJAX request is launched that rechecks accesses and redraws changed parts of the page. For example, there was only a coffee break option available, and another “meeting with a star” or “selfie with a lecturer” was added. === More difficult to implement, but ... so, in theory, everything should work.
Unfortunately, neither the first nor the second option was implemented.