redash/migrations/0022_add_new_permissions.py

11 lines
464 B
Python
Raw Normal View History

2016-02-21 12:08:49 +00:00
from redash import models
if __name__ == '__main__':
with models.db.database.transaction():
groups = models.Group.select(models.Group.id, models.Group.permissions).where(models.Group.name=='default')
for group in groups:
group.permissions.append('list_dashboards')
group.permissions.append('list_alerts')
group.permissions.append('list_data_sources')
2016-03-27 07:26:09 +00:00
group.save(only=[models.Group.permissions])