Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10235

DisableServiceUser does not allow to retrieve original disable-reason

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Repoinit Parser 1.6.6
    • Repoinit Parser 1.6.8
    • Repoinit
    • None

    Description

      bdelacretaz, during preliminary investigation into SLING-10219 i noticed that there is no way to obtain the original disable reason from DisableServiceUser operation.

      for the documented example:

      disable service user deprecated_service_user : "Disabled user to make an example"
      

      the jcr-repoinit UserVisitor.visitDisableServiceUser will do the following:

          public void visitDisableServiceUser(DisableServiceUser dsu) {
              final String username = dsu.getUsername();
              final String reason = dsu.getParametersDescription();
              [...]
          }
      

      however, DisableServiceUser.getParametersDescription looks as follows:

      public String getParametersDescription() {
              StringBuilder sb = new StringBuilder();
              sb.append(super.getParametersDescription());
              if (this.reason != null) {
                  sb.append(" : ");
                  sb.append(this.reason);
              }
      
              return sb.toString();
          }
      

      where super.getParametersDescription()) returns the userName.

      so, the resulting disable reason stored in the repository will be:
      "deprecated_service_user : Disabled user to make an example"
      instead of
      "Disabled user to make an example"

      note, that there is no other way to retrieve the original reason (e.g. DisableServiceUser.getReason() which means for SLING-10219 that the param-description needs to be parsed again i.e. relying on implementation detail, which looks quite wrong.

      Attachments

        Issue Links

          Activity

            People

              bdelacretaz Bertrand Delacretaz
              angela Angela Schreiber
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: