mraible commented on code in PR #322:
URL: https://github.com/apache/roller/pull/322#discussion_r4609094207


##########
app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MemberResign.java:
##########
@@ -68,6 +68,10 @@ public String execute() {
     public String resign() {
         try {
             UserManager umgr = 
WebloggerFactory.getWeblogger().getUserManager();
+            if (isLastAdmin(umgr)) {

Review Comment:
   Resigning and the Members page now go through one 
UserManager.updateWeblogMembership() operation that locks the weblog's row 
(PESSIMISTIC_WRITE), re-reads its memberships, refuses changes that would leave 
no enabled administrator, and applies them in the same transaction. 
WeblogMembershipTest covers the operation directly and through Members.save, 
and a test with two administrators resigning at the same moment, which let both 
resign before the change, now leaves exactly one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to