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

Fixing the roles auto maintenance #134

Merged
merged 1 commit into from
Feb 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions panoramix/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def init():

perms = db.session.query(ab_models.PermissionView).all()
for perm in perms:
if perm.permission.name == 'datasource_access':
continue
if perm.view_menu.name not in (
'UserDBModelView', 'RoleModelView', 'ResetPasswordView',
'Security'):
Expand All @@ -164,18 +166,19 @@ def init():
s = perm.permission.name
if(
perm.view_menu.name not in (
'UserDBModelView',
'RoleModelView',
'ResetPasswordView',
'RoleModelView',
'UserDBModelView',
'Security') and
perm.permission.name not in (
'can_edit',
'all_datasource_access',
'can_add',
'can_save',
'can_download',
'muldelete',
'all_datasource_access',
'can_delete',
'can_edit',
'can_save',
'datasource_access',
'muldelete',
)):
sm.add_permission_role(gamma, perm)
session = db.session()
Expand Down