AnsweredAssumed Answered

Some questions about the System user

Question asked by sebp on Jun 8, 2009
I try to copy a node programmatically using fileFolderService.copy(…) as the System user. The code looks like this:



    void send(final Node resource, final NodeRef targetFolder)
      final RetryingTransactionCallback<String> processMessageCallback = new RetryingTransactionCallback<String>() {
         public String execute() throws Throwable {
            fileFolderService.copy(resource.getNodeRef(), targetFolder, null);
         }
      };
      
      RunAsWork<String> processMessageRunAsWork = new RunAsWork<String>() {
         public String doWork() throws Exception {
            return retryingTransactionHelper.doInTransaction(processMessageCallback);
         }
      };
         
      try {
         String message = AuthenticationUtil.runAs(processMessageRunAsWork,
               AuthenticationUtil.SYSTEM_USER_NAME);
      } catch (Exception e) {
         logger.error(e);
      }

When I run this code I can see in the error messages that Alfresco tries to create a new user named "System" and tries to create a home folder named user_homes/System. It fails creating the home folder but when I log in as admin and create the folder manually then the code above runs without problems. When I check the list of users I can see a user named System.
Now some questions arise: Is it normal that the system user can be seen in the list of users? Why does Alfresco (community 2.9b) fail to create the home folder for the system user automatically? What happens to the System user if I switch to ntlm + AD authentication and all alfresco users are dropped?

Outcomes