-
Type:
Suggestion
-
Resolution: Unresolved
-
None
-
Component/s: Editor - Drafts, User - Management
-
4
Problem Definition
Disabling an user means that the administrator is revoking user's access to Confluence and the user won't be able to curate content anymore:
When an user account is disabled:
- The user won't be able to log in.
- The user won't be included in your license count.
- People won't be able to see the user in the People directory, mention them, or select their name/username as a search filter.
- Their full name will still appear on any spaces or content they created.
- They will be listed in User Management admin screens.
- Their account can be re-enabled (this will restore the connection to their content).
- Any content they created will be maintained.
When Collaborative Editing is disabled, users create personal drafts that accessible just to them.
If an user is disabled, their personal drafts are kept in the database (and attachments in the file system) when no one else can access these contents.
Depending on the size of the Confluence instance, the content footprint may be too large and periodically removing it may be a good thing.
Suggested Solution
Create a scheduled task to delete personal drafts associated to users that were disabled.
Since disabling an account is something that can be reverted, this scheduled task could check those accounts that are disabled for some time (i.e. one month).
Workaround
As a workaround, the Confluence administrator can discard drafts from disabled users using a REST API method.
The SQL query below identify the ID of personal drafts associated to users that were disabled:
select c.CONTENTID as DRAFT_ID from CONTENT c where c.CONTENTTYPE='DRAFT' and c.DRAFTTYPE='page' and c.CREATOR in (select um.USER_KEY from CWD_USER cu join USER_MAPPING um on um.LOWER_USERNAME=cu.LOWER_USER_NAME where cu.ACTIVE='F');
With this list in hand, the following REST API method can be used to discard each personal draft:
CONFBASEURL=<Confluence Base URL> ADMIN_USERNAME=<Confluence administrator username> ADMIN_PWD=<Confluence administrator password> DRAFT_ID=<draft ID from SQL query> curl -i -u $ADMIN_USERNAME:$ADMIN_PWD $CONFBASEURL'/rest/api/content/'$DRAFT_ID'?status=draft' -X DELETE -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest'
- relates to
-
CONFSERVER-58545 Deleting users from Confluence does not delete their personal drafts
-
- Long Term Backlog
-