User tests: Successful: Unsuccessful:
Pull Request for Issue #45971.
fixed form level.xml
use the POST with `` endpoint /api/index.php/v1/users/levels with this payload to create a User Access Level
{
"id":"0",
"title": "aaTechnician",
"rules": "[1,2]"
}
HTTP 400 Bad request
{
"errors": [
{
"title": "Field required: id"
}
]
}
HTTP 200 ok
{
"links": {
"self": "https://localhost:80/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "16",
"attributes": {
"id": 16,
"title": "aaTechnician",
"rules": [
1,
2
]
}
}
}
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_users |
| Title |
|
||||||
| Labels |
Added:
bug
Webservices
PR-5.3-dev
|
||
| Category | Administration com_users | ⇒ | Administration com_users JavaScript Unit Tests |
| Labels |
Added:
Unit/System Tests
|
||
added some system test
This pull request has been automatically rebased to 5.4-dev.
| Title |
|
||||||
| Labels |
Removed:
PR-5.3-dev
|
||
I have tested this item ✅ successfully on 0767cb6
Before patch:
✗ FAIL users_levels_POST_PR46080_1 - POST /v1/users/levels - 400 - 66.24 ms
✗ FAIL users_levels_POST_PR46080_2 - POST /v1/users/levels - 400 - 34.47 ms
Details:
────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST https://joomla.sviluppo.online/api/index.php/v1/users/levels
REQUEST:
ℹ Method: POST
ℹ Endpoint: /v1/users/levels
ℹ Headers:
• Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
• Content-Type: application/vnd.api+json
• Accept: application/vnd.api+json
ℹ Payload:
{
"id": "0",
"title": "API Test 1 Level 1767370915",
"rules": "[1,2]"
}
RESPONSE:
ℹ Status: 400 (Bad Request)
ℹ Duration: 66.24 ms
ℹ Headers:
• Content-Type: application/vnd.api+json; charset=utf-8
ℹ Body:
{
"errors": [
{
"title": "Field required: id"
}
]
}
✗ ✗ Test failed (HTTP 400)
✗ • Error: Field required: id
────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST https://joomla.sviluppo.online/api/index.php/v1/users/levels
REQUEST:
ℹ Method: POST
ℹ Endpoint: /v1/users/levels
ℹ Headers:
• Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
• Content-Type: application/vnd.api+json
• Accept: application/vnd.api+json
ℹ Payload:
{
"title": "API Test 2 Level 1767370915",
"rules": "[1,2]"
}
RESPONSE:
ℹ Status: 400 (Bad Request)
ℹ Duration: 34.47 ms
ℹ Headers:
• Content-Type: application/vnd.api+json; charset=utf-8
ℹ Body:
{
"errors": [
{
"title": "Field required: id"
}
]
}
✗ ✗ Test failed (HTTP 400)
✗ • Error: Field required: id
After Patch:
✓ PASS users_levels_POST_PR46080_1 - POST /v1/users/levels - 200 - 87.35 ms
✓ PASS users_levels_POST_PR46080_2 - POST /v1/users/levels - 200 - 43.59 ms
Details:
────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST https://joomla.sviluppo.online/api/index.php/v1/users/levels
REQUEST:
ℹ Method: POST
ℹ Endpoint: /v1/users/levels
ℹ Headers:
• Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
• Content-Type: application/vnd.api+json
• Accept: application/vnd.api+json
ℹ Payload:
{
"id": "0",
"title": "API Test 1 Level 1767371075",
"rules": "[1,2]"
}
RESPONSE:
ℹ Status: 200 (OK)
ℹ Duration: 87.35 ms
ℹ Headers:
• Content-Type: application/vnd.api+json; charset=utf-8
ℹ Body:
{
"links": {
"self": "https://joomla.sviluppo.online/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "7",
"attributes": {
"id": 7,
"title": "API Test 1 Level 1767371075",
"rules": [
1,
2
]
}
}
}
✓ ✓ Test passed
ℹ Response contains: 3 item(s)
────────────────────────────────────────────────────────────────────────────────
Create a new user access level
────────────────────────────────────────────────────────────────────────────────
POST https://joomla.sviluppo.online/api/index.php/v1/users/levels
REQUEST:
ℹ Method: POST
ℹ Endpoint: /v1/users/levels
ℹ Headers:
• Authorization: Bearer c2hhMjU2OjEyNjo1MWEzYzUyZmQ4Yz...
• Content-Type: application/vnd.api+json
• Accept: application/vnd.api+json
ℹ Payload:
{
"title": "API Test 2 Level 1767371075",
"rules": "[1,2]"
}
RESPONSE:
ℹ Status: 200 (OK)
ℹ Duration: 43.59 ms
ℹ Headers:
• Content-Type: application/vnd.api+json; charset=utf-8
ℹ Body:
{
"links": {
"self": "https://joomla.sviluppo.online/api/index.php/v1/users/levels"
},
"data": {
"type": "levels",
"id": "8",
"attributes": {
"id": 8,
"title": "API Test 2 Level 1767371075",
"rules": [
1,
2
]
}
}
}
✓ ✓ Test passed
ℹ Response contains: 3 item(s)
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/46080">issues.joomla.org/tracker/joomla-cms/46080</a>.</sub>
Would you mind to add a system test for it?