ILIAS icon indicating copy to clipboard operation
ILIAS copied to clipboard

Centralized lastAdmin validation inside the membership deletion

Open iszmais opened this issue 3 years ago • 1 comments

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

iszmais avatar Feb 23 '22 10:02 iszmais

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

iszmais avatar Feb 23 '22 11:02 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!

chfsx avatar Jan 24 '23 12:01 chfsx

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 avatar May 08 '23 14:05 alex40724

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

iszmais avatar May 09 '23 12:05 iszmais

This can be close since it was already altarnativöy solved

iszmais avatar Jun 26 '23 08:06 iszmais