hterik opened a new issue, #34718:
URL: https://github.com/apache/airflow/issues/34718

   ### Description
   
   We want to create custom roles in airflow that inherit the standard roles 
described on 
https://airflow.apache.org/docs/apache-airflow/2.7.1/security/access-control.html,
   
   More specifically, we want a derivative of `User` that can not delete dags 
and that has access to cluster activity dashboard. Otherwise all the 
permissions from `User`+`Viewer` should be inherited. (Recommendation from page 
above is to not alter the existing roles, instead create new ones)
   
   Creating new roles using the web ui is very tedious and error prone, without 
good review-process or git log history.
   Moreover, our entire Airflow installation is based on config-as-code so 
nobody has the admin role in Airflow and can create new roles easily, without 
having to login as root under the hood.
   
   Using configuration as code to create the roles would make this process a 
lot easier. 
   Proposal is a new python-function in `airflow_local_settings.py`, where one 
can read the `AirflowSecurityManager.USER_PERMISSIONS` programmatically to 
add/exclude permissions from the new returned role. These would take effect on 
next webserver restart.
   I don't know if there is any requirements on history for removed 
permissions/roles that could cause problem if one simply adds/removes roles 
there?
   
   
   
   As workaround i'm now considering a combo of `airflow roles list -p -o json` 
+ processing + `airflow roles import`.
   Is it possible to maybe just call the internal functions `patch_role` 
`post_role`? In that case when should one do that? Just once and then it will 
be persisted in DB?
   
   ### Use case/motivation
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to