> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mastermindcms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UserManagementServiceImpl

> Вызов публичных методов сервиса через REST API: userManagementServiceImpl

<ResponseField name="beanId" type="string">
  Идентификатор Spring bean, который содержит вызываемый сервис.

  userManagementServiceImpl
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Область действия bean. Для вызовов сервисов используется PROTOTYPE.
</ResponseField>

<ResponseField name="functionName" type="string">
  Имя публичного метода сервиса, указанное в сигнатуре ниже.
</ResponseField>

<ResponseField name="args" type="object[]">
  Массив аргументов метода. Каждый аргумент передаётся объектом с индексом 0, 1 и т. д.; значение должно соответствовать Java-типу параметра.
</ResponseField>

## Headers

```http theme={null}
POST /api/v1/bean/request
Content-Type: application/json
Lang-Context: ru
Site-Context: my-site
Authorization: Bearer <token>
```

Заголовки `Lang-Context` и `Site-Context` необходимо передавать в каждом запросе. Для защищённых методов передавайте JWT в заголовке `Authorization` в формате `Bearer <token>`.

**Доступ:** USER или ADMIN. **Bearer Token:** требуется.

* GUEST — без логина; доступен только whitelist.
* USER — требуется авторизация; доступны методы с проверкой USER.
* ADMIN — полный доступ к public-методам всех сервисов.
* Если метод проверяет роль внутри логики, GUEST может получить null.

## Методы

<ResponseField name="getRepository" type="UserRepository">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getRepository

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getRepository",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getPaginationFilter" type="Deque<Map<String, Object>>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### getPaginationFilter

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getPaginationFilter",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchUsers" type="LinkedHashSet<User>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### searchUsers

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchUsers",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchUsersPaged" type="Page<User>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### searchUsersPaged

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchUsersPaged",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getPrincipal" type="UserPrincipal">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getPrincipal

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getPrincipal",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getLoggedUser" type="User">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getLoggedUser

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getLoggedUser",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="isSuperUser" type="boolean">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### isSuperUser

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "isSuperUser",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="isLogged" type="boolean">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### isLogged

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "isLogged",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="isNotLogged" type="boolean">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### isNotLogged

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "isNotLogged",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="searchUsers" type="List<User>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `query`  | `String` | Передаётся через `args[0].0`. |
  | `from`   | `int`    | Передаётся через `args[1].1`. |
  | `to`     | `int`    | Передаётся через `args[2].2`. |

  ### searchUsers

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchUsers",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="createUser" type="Optional<User>">
  | Аргумент    | Тип                             | Описание                      |
  | ----------- | ------------------------------- | ----------------------------- |
  | `userAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### createUser

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "username":  null,
      "password":  null,
      "savedPassword":  null,
      "fallIntoObjects":  null,
      "active":  false,
      "roles":  null,
      "permissions":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "createUser",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveUser" type="Optional<User>">
  | Аргумент    | Тип                             | Описание                      |
  | ----------- | ------------------------------- | ----------------------------- |
  | `userAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### saveUser

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "username":  null,
      "password":  null,
      "savedPassword":  null,
      "fallIntoObjects":  null,
      "active":  false,
      "roles":  null,
      "permissions":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveUser",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeUserAndClean" type="void">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `userId` | `String` | Передаётся через `args[0].0`. |

  ### removeUserAndClean

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeUserAndClean",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeUsersByIds" type="void">
  | Аргумент  | Тип                 | Описание                      |
  | --------- | ------------------- | ----------------------------- |
  | `userIds` | `ArrayList<String>` | Передаётся через `args[0].0`. |

  ### removeUsersByIds

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeUsersByIds",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="revertPasswordToSaved" type="Optional<User>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `userId` | `String` | Передаётся через `args[0].0`. |

  ### revertPasswordToSaved

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "revertPasswordToSaved",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveSavedPassword" type="void">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `userId` | `String` | Передаётся через `args[0].0`. |

  ### saveSavedPassword

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveSavedPassword",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="isUserPermissionAll" type="boolean">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### isUserPermissionAll

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "isUserPermissionAll",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="isUserPermissionApplication" type="boolean">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### isUserPermissionApplication

  ```json theme={null}
  {
    "beanId": "userManagementServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "isUserPermissionApplication",
    "args": []
  }
  ```
</ResponseField>
