selfadmin.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .. _rest_api_selfadmin:
  2. Self admin
  3. ==========
  4. Self admin operations allow a user to perform actions on the user's own info.
  5. Calls to the self admin operations are disabled by default. You'll have to edit the ``rest.properties``
  6. file (more info at the :ref:`security_service_rest` page) and add the line::
  7. /rest/security/self/**;GET,POST,PUT,DELETE=ROLE_AUTHENTICATED
  8. ``/security/self/password``
  9. ---------------------------------
  10. Allows a user to change own password
  11. .. warning::
  12. The use of HTTPS is recommended, otherwise all password are sent in plain text.
  13. .. list-table::
  14. :header-rows: 1
  15. * - Method
  16. - Action
  17. - Status code
  18. - Formats
  19. - Default Format
  20. * - PUT
  21. - Changes the user password
  22. - 200,400,424
  23. - XML, JSON
  24. -
  25. Formats for PUT (password change).
  26. **XML**
  27. .. code-block:: xml
  28. <userPassword>
  29. <newPassword>newPassword</newPassword>
  30. </userPassword>
  31. **JSON**
  32. .. code-block:: json
  33. { "newPassword":"newPassword" }
  34. Exceptions
  35. ~~~~~~~~~~
  36. .. list-table::
  37. :header-rows: 1
  38. :widths: 30 10 30
  39. * - Exception
  40. - Status code
  41. - Error string (payload)
  42. * - PUT with an invalid ``newPassword`` or bad params
  43. - 400
  44. - ``Missing 'newPassword'``
  45. * - PUT for user not updatable
  46. - 424
  47. - ``User service does not support changing pw``