# How do I delete a user?

**URL:** <https://community.ofelia.com/t/how-do-i-delete-a-user/4864>\
**Category:** Q&A\
**Created:** [11 July 2014 21:38 UTC](https://community.ofelia.com/t/how-do-i-delete-a-user/4864 "2014-07-11T21:38:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricardo.g](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ricardo.g](https://community.ofelia.com/u/ricardo.g)\
**Post date:** [11 July 2014 21:38 UTC](https://community.ofelia.com/t/how-do-i-delete-a-user/4864/1 "2014-07-11T21:38:50Z")

</div>

I see no option for doing this, even for a user that I just created. Using BPM 6.3.2.

---

<div class="post-metadata">

**Author:** ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)\
**Post date:** [14 July 2014 09:35 UTC](https://community.ofelia.com/t/how-do-i-delete-a-user/4864/2 "2014-07-14T09:35:57Z")

</div>

You can desactivate a user by clicking on “desactivate” (bottom right of the screen when user is selected)

For business consistency reasons you can not delete a user “easily”

---

<div class="post-metadata">

**Author:** ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)\
**Post date:** [14 July 2014 20:45 UTC](https://community.ofelia.com/t/how-do-i-delete-a-user/4864/3 "2014-07-14T20:45:48Z")

</div>

WARNING: I am not shure about the following (i am not a Bonita expert).

IF that user is really not implied in any activity and IF he is not bound to other users by hierarchical associactions I suppose you may disable this user as told and then:

delete from user\_ where not enabled;

On my DBMS (Postgres), fields referenced by other tables are set to “ON DELETE CASCADE” so this query makes by itself all the job.

If this user has the role of manager for another or has played a role in some activities, that’s another story …

---

<div class="post-metadata">

**Author:** ![yannick.lombardi](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yannick.lombardi](https://community.ofelia.com/u/yannick.lombardi)\
**Post date:** [16 July 2014 08:41 UTC](https://community.ofelia.com/t/how-do-i-delete-a-user/4864/4 "2014-07-16T08:41:56Z")

</div>

I think you can use the méthode deleteUser() in the identityApi :  
[http://documentation.bonitasoft.com/javadoc/api/6.3/org/bonitasoft/engine/api/UserAPI.html#deleteUser(long)](http://documentation.bonitasoft.com/javadoc/api/6.3/org/bonitasoft/engine/api/UserAPI.html#deleteUser%28long%29)

---

<div class="post-metadata">

**Author:** ![rahmi.hichem](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rahmi.hichem](https://community.ofelia.com/u/rahmi.hichem)\
**Post date:** [16 July 2014 13:38 UTC](https://community.ofelia.com/t/how-do-i-delete-a-user/4864/5 "2014-07-16T13:38:23Z")

</div>

You can do this by groovy. At firt, you have to get your user username, afther that you use the deleteuser(Username) , methode

---

<div class="post-metadata">

**Author:** ![ricardo.g](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ricardo.g](https://community.ofelia.com/u/ricardo.g)\
**Post date:** [14 July 2014 16:03 UTC](https://community.ofelia.com/t/how-do-i-delete-a-user/4864/6 "2014-07-14T16:03:58Z")

</div>

Yes, I know that. You should, however, allow the ability to delete an account that has no dependencies. What is the “hard way”? I am a developer.
