Feature #22434

Block user via API

Added by Evgeniy Dushistov over 1 year ago. Updated over 1 year ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:REST API
Target version:-
Resolution:

Description

According to Rest_Users there is no way to change user state to blocked.

This is very useful feature for script that automate person discharge.

I have script that do suitable magic with LDAP, but for redmine I can only delete user, not block, so every time I have to block user account in redmine by hands.

History

#1 Updated by Holger Just over 1 year ago

You can set the status of the user using a PUT request. There, you can set the status as follows (here using json):

{
  "user": {
    "status": 3
  }
}

The status values are as follows:

  • STATUS_ACTIVE = 1 (User can login and use their account)
  • STATUS_REGISTERED = 2 (User has registered but not yet confirmed their email address or was not yet activated by an administrator. User can not login)
  • STATUS_LOCKED = 3 (User was once active and is now locked, User can not login)

#2 Updated by Toshi MARUYAMA over 1 year ago

  • Description updated (diff)

Also available in: Atom PDF