cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove alfresco user?

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi All,  Smiley Very Happy
   In my project I need to remove the user when some event occurred. I meant, I don't want to remove user form the UI but at some point the user will get deleted by the java code. I have tried it but I am getting exception…. 😞

AuthenticationUtil.setRunAsUserSystem();
AuthorityService authorityService = serviceRegistry.getAuthorityService();

Line 1. authorityServiceImpl.deleteAuthority("test-212379");   //I have tried both Line 1 and Line 2 one by one. Both throwing exception.
Line 2.  serviceRegistry.getPersonService().deletePerson("test-212379");
                         
AuthenticationUtil.clearCurrentSecurityContext();

———————————————————————-
When I run the code in line 1 it throws exception like : Trying to modify fixed properties.
In the line 2 the exception is : 10100031 Access Denied.  The system is currently in read-only mode.

Please help meSmiley Very Happy
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
You need to work out why your system is in read only mode.     There will be a message in the log file.

Your code is probably irrelevant.

mcasanket
Champ on-the-rise
Champ on-the-rise
Thanks  mrogers for your reply…  Smiley Very Happy
  
  How I can check that why my system is in read only mode?
  However I am able to remove users from UI by login alfresco side with admin credentials.

  Thank you!