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

Jörg Hoh commented on SLING-7960:
---------------------------------

Bertrand suggested this:

# Introduce a new DELETE REAL USER <u> command that only deletes real users.
# Keep DELETE USER <u> as is, deleting both types of users. Document these 
commands better to avoid confusion here.
# Fix DELETE SERVICE USER <u> so that it only deletes service users.
# None of these commands fail if <u> is not of the expected type or does not 
exist, they just log INFO messages in such cases.

Let's do it as Bertrand suggested.

To get this work I needed to change both the repoinit-parser and jcr-repoinit 
modules. Therefor I have 2 patches:
*  [^SLING-7960-4-oasrp.patch]  for org.apache.sling.repoinit.parser and
*  [^SLING-7960-4-oasjr.patch]  for org.apache.sling.jcr.repoinit

Notable changes:
* I needed to bump the package version of 
org.apache.sling.repoinit.parser.operations to 4.2.0
* "DELETE USER u" will work as it did before, but I it will always log a 
warning to user either "DELETE SERVICE USER" or "DELETE REAL USER" for 
disambiguation.


> Repoinit: "delete user" also deletes service user
> -------------------------------------------------
>
>                 Key: SLING-7960
>                 URL: https://issues.apache.org/jira/browse/SLING-7960
>             Project: Sling
>          Issue Type: Bug
>          Components: Repoinit
>    Affects Versions: Repoinit JCR 1.1.8
>            Reporter: Jörg Hoh
>            Priority: Major
>         Attachments: SLING-7960-2.patch, SLING-7960-3.patch, 
> SLING-7960-4-oasjr.patch, SLING-7960-4-oasrp.patch, 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". Which is totally unexpected, 
> because there is a dedicated command "delete service user" which is supposed 
> to remove users. So "delete user foo" must only delete a regular user "foo" 
> but not a service user named "foo".
>  



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

Reply via email to