troxil commented on issue #34718:
URL: https://github.com/apache/airflow/issues/34718#issuecomment-1752174320
We do this in `webserver_config.py` - our version (2.5.3) adds new roles to
`AirflowSecurityManager.ROLE_CONFIGS` based on permissions :
`AirflowSecurityManager.VIEWER_PERMISSIONS` +
`AirflowSecurityManager.USER_PERMISSIONS` exactly as you describe.
```python
add_roles = ["abc", "def", "ghi"]
AirflowSecurityManager.ROLE_CONFIGS.extend(
[
{"role": role, "perms":
AirflowSecurityManager.VIEWER_PERMISSIONS +
AirflowSecurityManager.USER_PERMISSIONS}
for role in add_roles
]
)
```
This is supported as much as we're using these primitives available to us.
FYI we use a custom SecurityManager (parent is of course
`AirflowSecurityManager`) and override in flask's `SECURITY_MANAGER_CLASS` and
set this new security managers `ROLE_CONFIGS` to be a union of the new configs
(as above) + existing ones.
Hope this helps.
--
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]