You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by dp...@apache.org on 2021/02/02 15:19:37 UTC
[superset] branch master updated: fix: allow users to reset their
passwords (#12886)
This is an automated email from the ASF dual-hosted git repository.
dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 9cc38ac fix: allow users to reset their passwords (#12886)
9cc38ac is described below
commit 9cc38ac1d93a44925d9cd8dcc49fb2a204ef7308
Author: Daniel Vaz Gaspar <da...@gmail.com>
AuthorDate: Tue Feb 2 15:19:09 2021 +0000
fix: allow users to reset their passwords (#12886)
---
superset/security/manager.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/superset/security/manager.py b/superset/security/manager.py
index 43461f1..8f05358 100644
--- a/superset/security/manager.py
+++ b/superset/security/manager.py
@@ -179,7 +179,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
"metric_access",
}
- ACCESSIBLE_PERMS = {"can_userinfo"}
+ ACCESSIBLE_PERMS = {"can_userinfo", "resetmypassword"}
data_access_permissions = (
"database_access",
@@ -710,7 +710,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
self.get_session.merge(role)
self.get_session.commit()
- def _is_admin_only(self, pvm: Model) -> bool:
+ def _is_admin_only(self, pvm: PermissionView) -> bool:
"""
Return True if the FAB permission/view is accessible to only Admin users,
False otherwise.
@@ -731,7 +731,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
or pvm.permission.name in self.ADMIN_ONLY_PERMISSIONS
)
- def _is_alpha_only(self, pvm: PermissionModelView) -> bool:
+ def _is_alpha_only(self, pvm: PermissionView) -> bool:
"""
Return True if the FAB permission/view is accessible to only Alpha users,
False otherwise.
@@ -750,7 +750,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
or pvm.permission.name in self.ALPHA_ONLY_PERMISSIONS
)
- def _is_accessible_to_all(self, pvm: PermissionModelView) -> bool:
+ def _is_accessible_to_all(self, pvm: PermissionView) -> bool:
"""
Return True if the FAB permission/view is accessible to all, False
otherwise.
@@ -761,7 +761,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
return pvm.permission.name in self.ACCESSIBLE_PERMS
- def _is_admin_pvm(self, pvm: PermissionModelView) -> bool:
+ def _is_admin_pvm(self, pvm: PermissionView) -> bool:
"""
Return True if the FAB permission/view is Admin user related, False
otherwise.
@@ -772,7 +772,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
return not self._is_user_defined_permission(pvm)
- def _is_alpha_pvm(self, pvm: PermissionModelView) -> bool:
+ def _is_alpha_pvm(self, pvm: PermissionView) -> bool:
"""
Return True if the FAB permission/view is Alpha user related, False
otherwise.
@@ -785,7 +785,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
self._is_user_defined_permission(pvm) or self._is_admin_only(pvm)
) or self._is_accessible_to_all(pvm)
- def _is_gamma_pvm(self, pvm: PermissionModelView) -> bool:
+ def _is_gamma_pvm(self, pvm: PermissionView) -> bool:
"""
Return True if the FAB permission/view is Gamma user related, False
otherwise.
@@ -800,7 +800,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
or self._is_alpha_only(pvm)
) or self._is_accessible_to_all(pvm)
- def _is_sql_lab_pvm(self, pvm: PermissionModelView) -> bool:
+ def _is_sql_lab_pvm(self, pvm: PermissionView) -> bool:
"""
Return True if the FAB permission/view is SQL Lab related, False
otherwise.
@@ -828,7 +828,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
)
def _is_granter_pvm( # pylint: disable=no-self-use
- self, pvm: PermissionModelView
+ self, pvm: PermissionView
) -> bool:
"""
Return True if the user can grant the FAB permission/view, False