[ 
https://issues.apache.org/jira/browse/SLING-10235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17307672#comment-17307672
 ] 

Bertrand Delacretaz commented on SLING-10235:
---------------------------------------------

bq. shouldn't the implementation in sling.jcr.repoinit be adjusted as well...

Yes. I don't have time for that right now but feel free to make that change. 
I'm not sure if the existing tests verify that disabling message, if not it 
would be good to add that as well.

> DisableServiceUser does not allow to retrieve original disable-reason
> ---------------------------------------------------------------------
>
>                 Key: SLING-10235
>                 URL: https://issues.apache.org/jira/browse/SLING-10235
>             Project: Sling
>          Issue Type: Bug
>          Components: Repoinit
>    Affects Versions: Repoinit Parser 1.6.6
>            Reporter: Angela Schreiber
>            Assignee: Bertrand Delacretaz
>            Priority: Major
>             Fix For: Repoinit Parser 1.6.8
>
>
> [~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:
> {code}
> disable service user deprecated_service_user : "Disabled user to make an 
> example"
> {code}
> the jcr-repoinit {{UserVisitor.visitDisableServiceUser}} will do the 
> following:
> {code}
>     public void visitDisableServiceUser(DisableServiceUser dsu) {
>         final String username = dsu.getUsername();
>         final String reason = dsu.getParametersDescription();
>         [...]
>     }
> {code}
> however, {{DisableServiceUser.getParametersDescription}} looks as follows:
> {code}
> public String getParametersDescription() {
>         StringBuilder sb = new StringBuilder();
>         sb.append(super.getParametersDescription());
>         if (this.reason != null) {
>             sb.append(" : ");
>             sb.append(this.reason);
>         }
>         return sb.toString();
>     }
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to