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

Angela Schreiber edited comment on SLING-10235 at 3/24/21, 9:56 AM:
--------------------------------------------------------------------

[~bdelacretaz], i don't have time either...... but feel free to clone the issue 
such that the 2 separate parts are reflected:
- fix the operation in the parser
- fix the implementation using the operation in jcr-repoinit that currently 
write to wrong string to the User.disable method.


was (Author: anchela):
[~bdelacretaz], i don't have time either......

> 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