SetBlackToPlayEvent();
        break;
 
+      case NoRights:
+       rightsBoard[y][x] = 0;
+        break;
+
+      case GrantRights:
+        { ChessSquare p = boards[0][y][x];
+         rightsBoard[y][x] = 1;
+         if(p == WhiteKing || p == WhiteUnicorn || p == BlackKing || p == BlackUnicorn)
+               rightsBoard[y][x] = 2;
+       }
+        break;
+
       case EmptySquare:
        if (gameMode == IcsExamining) {
             if (x < BOARD_LEFT || x >= BOARD_RGHT) break; // [HGM] holdings
 
     BlackSilver, BlackFalcon, BlackLance, BlackCobra, BlackUnicorn, BlackKing,
     EmptySquare, 
     NoRights, // [HGM] gamestate: for castling rights hidden in board[CASTLING]
+    GrantRights, // [HGM] promopopup: for EditPosition menu
     ClearBoard, WhitePlay, BlackPlay, PromotePiece, DemotePiece /*for use on EditPosition menus*/
   } ChessSquare;
 
 
     
     if (strcmp(name, _("clear board")) == 0) {
        EditPositionMenuEvent(ClearBoard, 0, 0);
+    } else
+    if (strcmp(name, _("grant rights")) == 0) {
+       EditPositionMenuEvent(GrantRights, fromX, fromY);
+    } else
+    if (strcmp(name, _("revoke rights")) == 0) {
+       EditPositionMenuEvent(NoRights, fromX, fromY);
     }
     PromoPopDown();
 }