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

Jörg Hoh edited comment on SLING-7960 at 9/28/18 11:10 AM:
-----------------------------------------------------------

It looks to me, that the implementation of both visitDeleteUser and 
visitDeleteServiceUser are identical.

 

See 
[https://github.com/apache/sling-org-apache-sling-jcr-repoinit/blob/master/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java#L94]
 and 
[https://github.com/apache/sling-org-apache-sling-jcr-repoinit/blob/master/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java#L60]

There should be an additional check that deleteUser does not accidently delete 
a service user.

But the tests are also affected in a way, that assertServiceUser() and 
assertUser() are identical:

[https://github.com/apache/sling-org-apache-sling-jcr-repoinit/blob/master/src/test/java/org/apache/sling/jcr/repoinit/impl/TestUtil.java#L81]

https://github.com/apache/sling-org-apache-sling-jcr-repoinit/blob/master/src/test/java/org/apache/sling/jcr/repoinit/impl/TestUtil.java#L97


was (Author: joerghoh):
It looks to me, that the implementation of both visitDeleteUser and 
visitDeleteServiceUser are identical.

 

See 
[https://github.com/apache/sling-org-apache-sling-jcr-repoinit/blob/master/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java#L94]
 and 
[https://github.com/apache/sling-org-apache-sling-jcr-repoinit/blob/master/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java#L60]

There should be an additional check that deleteUser does not accidently delete 
a service user.

> Repoinit: delete user does not distinguish between system user and regular 
> user
> -------------------------------------------------------------------------------
>
>                 Key: SLING-7960
>                 URL: https://issues.apache.org/jira/browse/SLING-7960
>             Project: Sling
>          Issue Type: Improvement
>          Components: Repoinit
>    Affects Versions: Repoinit JCR 1.1.8
>            Reporter: Jörg Hoh
>            Priority: Major
>         Attachments: SLING-7960.patch
>
>
> My current application uses a regular user, but with some changes to the 
> framework we need to migrate to regular service users. The service user is 
> being added as part of the deployment.
> To automate this I decided to use the repoinit to remove the regular user and 
> then deploy the service user. Which works fine, but only until the next time 
> the repoinit is executed again. Because then the repoinit statement
> {{delete user foo}}
> purges the newly created serviceuser "foo". It would be great if there would 
> be an distinction between deleting regular users and deleting service users, 
> as it is on creation as well.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to