GitHub user D2CIT edited a comment on the discussion: Airflow API creating roles

The log shows that a KeyError occurs because of the missing key 'permissions ’ 
in the JSON message I've send via the API. This means probably a missing 
required key in the API request.

I tried this suggestion

```
curl -X POST "http://localhost:8080/api/v1/roles"; \
-H "Content-Type: application/json" \
--data '{
  "name": "example_role",
  "permissions": [
    {
      "action": {
        "name": "can_read"
      },
      "resource": {
        "name": "DagRuns"
      }
    }
  ]
}

```
but then I get the following error
```
{
 "detail": null,
 "status": 403,
 "title": "Forbidden",
 "type": 
"https://airflow.apache.org/docs/apache-airflow/2.10.2/stable-rest-api-ref.html#section/Errors/PermissionDenied";
}
```

This error message indicates that the permissions field is treated as unknown 
by the Airflow API, despite being expected according to the code.


GitHub link: 
https://github.com/apache/airflow/discussions/43658#discussioncomment-11153428

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to