-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datasource access #28760
Comments
@Zarrina1 Hello there! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let's squash those bugs together! 🤖 To resolve the issue where a Gamma role user can see some datasets in the Dataset folder but cannot see the related dashboards for those datasets in Superset version 2.1.0, follow these steps:
By following these steps, you should be able to resolve the issue and ensure that the Gamma role user can see the related dashboards for the datasets they have access to [1][2][3][4][5].
|
@dosu |
You should write the def can_access_dashboard(self, dashboard: "Dashboard") -> bool:
"""
Return True if the user can access the specified dashboard, False otherwise.
:param dashboard: The dashboard
:returns: Whether the user can access the dashboard
"""
try:
self.raise_for_access(dashboard=dashboard)
except SupersetSecurityException:
return False
return True This method ensures that the permissions for accessing a dashboard are checked correctly by calling the
|
@dosu But why using some datasets dashboards are shown ,with other are not? |
The inconsistency in dashboards being shown for some datasets but not for others when accessed by a Gamma role user in Apache Superset version 2.1.0 is likely due to a permissions issue. Specifically, the fix for this issue is mentioned in the changelog: This fix ensures that objects (such as dashboards) are shown to users based on their database access permissions. To resolve this inconsistency, you should ensure that the Gamma role has the appropriate database access permissions for the datasets in question. Additionally, the integration tests for dashboard security in Superset provide further insights into how permissions are managed. For example, the Here is a code snippet to check and update the permissions for the Gamma role: from superset import security_manager
# Get the Gamma role
gamma_role = security_manager.find_role("Gamma")
# Ensure the Gamma role has the necessary database access permissions
databases = security_manager.get_all_databases()
for database in databases:
security_manager.add_permission_role(gamma_role, security_manager.find_permission_view_menu("database_access", database.perm))
# Commit the changes
security_manager.get_session.commit() This code ensures that the Gamma role has access to all databases, which should resolve the issue of dashboards not being shown for some datasets. Additionally, you can refer to the integration tests in
|
I hope the AI comments are helpful, but I'm going to go ahead and close this out since we no longer support Superset <3.1. I think you can continue the bot talk as long as you'd like, but I'd also encourage you join slack and see if others there are able to help, perhaps in the |
Bug description
Hello everyone!
I have Superset version 2.1.0
I have an issue while giving access to gamma role on particular dataset .
Normal situation is when I give datasource access to Gamma role. So after that Gamma-user can see dashboards where «my_dataset» was used as source and also Gamma user can see «my_dataset» in Dataset folder .This works with only some datasets .
Result:
Gamma Role with dataset access
What this Gamma Role will see :
Connected dashboard
Needed dataset
So another situation is when I give also datasource access to Gamma role but on another dataset (for ex- «dataset2» ) and dataset2 is used in some dashboards .This dashboards are not been displayed at all for the gamma-user but the user can see «dataset2» in Dataset folder .
Giving access process:
So all user is able to see :
But no dashboards !
How to solve it ?Why are dashboards been shown only with some datasets?
How to reproduce the bug
1.Create Gamma role with datasourse access on [Cluster].[dataset]
2.Gamma role user can see dataset but no related charts/dashboard
ps. dashboards are shown with some datasets ,with other datasets are not
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
I don't know
Node version
I don't know
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: