ILIAS
ILIAS copied to clipboard
Centralized lastAdmin validation inside the membership deletion
When you unsunscribe a user from multiple objects, the objects are not checked on if the user is the last admin of the object since these validation is only accessable for the single unsubscription.
This PR resolves the issue by centralizing the validation inside the deletion process instead of the confirm process.
Mantis Issue: https://mantis.ilias.de/view.php?id=29899
Thx for the quick response @smeyer-ilias !
I totally agree that that the Error handling and visualizing itself shouldnt be handled inside the ilParticipant. But i dont quite understand why the constraint shouldnt be checked there. Is there an exception to the concept of ILIAS participations, where admins are not required?
A updated the solution to handle the constraint more abstract. Would like to hear your opinion on this.
Greetings, @iszmais
Hi @smeyer-ilias
As Technical Board, we regularly check for pull requests that have been open for a long time. Any Updates on this? Note, that you can also close this, if you are not able or if you not have the ressources to look into it in detail.
Best regards!
if (!$this->getMembersObject()->deleteParticipants($participants)) {
ilUtil::sendFailure($this->lng->txt($this->getParentObject()->getType() . '_at_least_one_admin'), true);
The returned "false" should not represent this particular issue imo.
Final course/group deletion might be a process that needs deletion of all members regardless of this check, there might be other similar cases.
if (!$this->getMembersObject()->deleteParticipants($participants)) { ilUtil::sendFailure($this->lng->txt($this->getParentObject()->getType() . '_at_least_one_admin'), true);
The returned "false" should not represent this particular issue imo.
Final course/group deletion might be a process that needs deletion of all members regardless of this check, there might be other similar cases.
@alex40724 Thx for the hint! I changed the process to be result based for better identification withing the target occurences. I would still like this to be catnralized but totally agree that therefore it should be more detailed
(PS: in not fixed to the naming "unsibcribe" feel free to propose another, better fitting one).
Greetings, @iszmais
This can be close since it was already altarnativöy solved