英文:
Wazuh4.3 Api sent a post request to modify the role error
问题
使用Wazuh4.3 API进行POST请求修改用户角色时返回缺失的查询参数'role to me_ Ids,请问你能告诉我如何解决吗?
我已经查看了官方的最新文档,但没有找到解决方案。在搜索引擎上关于最新版本的信息非常有限。
英文:
I am using the Wazuh4.3 API to modify the user role using a post request, but return the Missing query parameter 'role to me_ Ids, could you please tell me how to solve it
I have checked the official latest documentation, but I have not found a solution. There is very little information on the latest version on the search engine.
答案1
得分: 1
以下是已经翻译好的部分:
你可以通过以下方式切换用户所属的角色:
例如:
你可以按照以下方式列出当前用户(ID、名称和角色)和角色:这是最新版本的完整API参考,如果你觉得有用的话:
英文:
You should be able to switch the role a user belongs to in this way:
# Unassign previous role (optional)
curl -k -X DELETE "https://localhost:55000/security/users/<USER_ID>/roles?role_ids=<ROLE_ID>" -H "Authorization: Bearer $TOKEN"
# Assign new role
curl -k -X POST "https://localhost:55000/security/users/<USER_ID>/roles?role_ids=<NEW_ROLE_ID>" -H "Authorization: Bearer $TOKEN"
For example:
# Unassign previous role (optional)
curl -k -X DELETE "https://localhost:55000/security/users/100/roles?role_ids=100" -H "Authorization: Bearer $TOKEN"
# Assign new role
curl -k -X POST "https://localhost:55000/security/users/100/roles?role_ids=101" -H "Authorization: Bearer $TOKEN"
You can list the current users (id, name and roles) and roles like this:
# List users
curl -k -X GET "https://localhost:55000/security/users?pretty=True" -H "Authorization: Bearer $TOKEN"
# List roles
curl -k -X GET "https://localhost:55000/security/roles?pretty=True" -H "Authorization: Bearer $TOKEN"
Here is the full API reference for the latest version, in case you find it useful:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论