forked from astronomer/astronomer-cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix displaying dbt docs as menu item in Astro (astronomer#1280)
As of Cosmos 1.7.0, Astro customers who have the role of "Organization Member" or "Workspace Operator" are not able to see the menu item "dbt Docs" under "Browser". They could access the `/cosmos/dbt_docs` view directly, though. This PR solves this issue. Closes: astronomer#1131 # About the solution This PR follows the Astro [documentation](https://www.astronomer.io/docs/learn/using-airflow-plugins#flask-blueprints-and-appbuilder-views) recommendation: > If you want to use custom menu items in an Airflow environment hosted on Astro, you must give your plugin the necessary permissions. To do this, use the @has_access decorator to give your BaseView method ACTION_CAN_ACCESS_MENU permissions. By adding: ``` @has_access([(permissions.ACTION_CAN_ACCESS_MENU, "Custom Menu")]) ``` # How the fix was tested In addition to the unit test that checks if all Cosmos plugin endpoints have the expected permissions, I also validated this change with a user with the "Organization Member" role. I confirmed that they could see the menu item and that it redirects to the correct page: 
- Loading branch information
Showing
4 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters