Skip to content

Commit

Permalink
Merge pull request #134 from mistercrunch/fix_init
Browse files Browse the repository at this point in the history
Fixing the roles auto maintenance
  • Loading branch information
mistercrunch committed Feb 12, 2016
2 parents baac8c4 + 53a0f81 commit 4acf186
Showing 1 changed file with 9 additions and 6 deletions.
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

0 comments on commit 4acf186

Please sign in to comment.