These are chat archives for getredash/redash

16th
Dec 2014
gilhoffer
@gilhoffer
Dec 16 2014 10:29
Hi guys, a quick question - is there anywhere documentation for the "permissions" which are available per user? (e.g. in order to create a read-only user, etc...) https://github.com/EverythingMe/redash/wiki/Users-management
Arik Fraimovich
@arikfr
Dec 16 2014 11:31
@gilhoffer actually no...
@gilhoffer you can see in controller.py what permissions the different APIs require and deduce from that :|
gilhoffer
@gilhoffer
Dec 16 2014 12:01
cool, that will do :)
Arik Fraimovich
@arikfr
Dec 16 2014 12:02
@gilhoffer there are some "client side" permissions (like edit_raw_chart or something like that). But most of them should be in the controller.
gilhoffer
@gilhoffer
Dec 16 2014 12:04
The list there is good enough for our use-case, I think it will do. as the list is basically (admin, create_dashboard, edit_dashboard, view_query, create_query, edit_query, execute_query), I guess that if I want a user which can just view dashboards, I should create one with no permissions, right?
Arik Fraimovich
@arikfr
Dec 16 2014 12:05
iirc, yes.
gilhoffer
@gilhoffer
Dec 16 2014 12:06
cool, 10x a lot
Arik Fraimovich
@arikfr
Dec 16 2014 12:06
you just create a group with empty permissions list, and assign him to this group
gilhoffer
@gilhoffer
Dec 16 2014 12:06
how do I create a group then?
Arik Fraimovich
@arikfr
Dec 16 2014 12:11
from the shell (/opt/redash/current -> sudo -u redash bin/run ./manage.py shell), type:
models.Group.create(name="readonly", permissions=[], tables=[])
gilhoffer
@gilhoffer
Dec 16 2014 12:38
cool, thanks!
gilhoffer
@gilhoffer
Dec 16 2014 13:58
one last question :) how do I assign a user to this group?
Arik Fraimovich
@arikfr
Dec 16 2014 14:44
@gilhoffer
u = models.User.get_by_email('user@example.com')
u.groups.append('readonly')
u.save()
@gilhoffer note that by default users created with the default group, so you might want to just assign the group instead of appending it (u.groups = ['readonly'])
gilhoffer
@gilhoffer
Dec 16 2014 15:05
you rock!
I think I'll devote some free time to add some beef to the manual :)
Arik Fraimovich
@arikfr
Dec 16 2014 15:55
@gilhoffer that will be awesome!