Skip to content
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

Permission creating hook on table creation is broken. #1944

Closed
bkyryliuk opened this issue Jan 11, 2017 · 3 comments · Fixed by #1950
Closed

Permission creating hook on table creation is broken. #1944

bkyryliuk opened this issue Jan 11, 2017 · 3 comments · Fixed by #1950
Assignees
Labels
airbnb Airbnb related change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead

Comments

@bkyryliuk
Copy link
Member

No description provided.

@bkyryliuk bkyryliuk added airbnb Airbnb related change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead labels Jan 11, 2017
@bkyryliuk bkyryliuk self-assigned this Jan 11, 2017
@bkyryliuk
Copy link
Member Author

Somehow the perm is created and the permission view menu is pointing to the datasource_access perm and null view menu.

Steps: create new table and the go to the ipython console:

t = db.session.query(models.SqlaTable).filter_by(id=2783).all()[0]
p = sm.find_permission_view_menu('datasource_access', t.get_perm())
p
>>> datasource access on None

@bkyryliuk
Copy link
Member Author

Looks like if the None view_menu or None permission exists it will cause sm.find_permission_view_menu to return that permission view menu object rather than None.

    def find_permission_view_menu(self, permission_name, view_menu_name):
        """
            Finds and returns a PermissionView by names
        """
        permission = self.find_permission(permission_name)
        view_menu = self.find_view_menu(view_menu_name)
        return self.get_session.query(self.permissionview_model).filter_by(permission=permission, view_menu=view_menu).first()

@bkyryliuk
Copy link
Member Author

FAB security manager still has to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
airbnb Airbnb related change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant