2 Replies Latest reply on Feb 6, 2015 11:37 AM by Adam Smierzchalski

    Cannot add mixin to a locked node

    Adam Smierzchalski Newbie

      I'm locking a node and want to add a new mixin type but i get a ConstraintViolationException. The addMixin(String mixinName) method have a checkForLock() method, this works fine because it also checks if the session is the lockowner. But in the method canAddMixin(String mixinName), which is called from addMixin, there is only a check if the node is locked and returns false without checking if the session is the lockowner.

       

              checkForLock();
              .
             .
             .
              if (!canAddMixin(mixinName)) {
                  throw new ConstraintViolationException(JcrI18n.cannotAddMixin.text(mixinName));
              }
      

       

              if (isLocked()) return false;
      


      For me it seems like a bug, or is this intended that you can't mixin types while the node is locked by yourself?


      We are using ModeShape 4.1.0-FINAL