AnsweredAssumed Answered

How to remove alfresco user?

Question asked by mcasanket on Nov 11, 2011
Latest reply on Nov 11, 2011 by mcasanket
Hi All,  :D
   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 me!  :D

Outcomes