Redash dashboards and queries can only be modified by admin or the owner. It doesn't matter if you belong to the same group.
Since it is possible to grant change permission to individual users, we will describe how to do so.
Redash 8.0.0+b32245 (a16f551e)
This can be achieved by adding a record to Redash's access_permissions
table.
I don't want to touch PostgreSQL directly, so I add a record by using AccessPermission.grant
.
Grant the dashboard modification authority held by one user (old_user) to another user (new_user).
Open a shell in Redash.
/opt/redash
docker-compose exec server ./manage.py shell
Copy and paste the following.
#
# ./manage.py shell
#
from redash.models.users import AccessPermission, User
from redash.models.base import db
from redash.models import Dashboard
from redash import permissions
from contextlib import contextmanager
old_user = User.get_by_id(5)
new_user = User.get_by_id(2)
def grant_dashboards():
all_dashboards = Dashboard.all(
old_user.org,
old_user.group_ids,
old_user.id,
)
not_exists_dashboards = not_exists_obj(all_dashboards)
grant(not_exists_dashboards)
def not_exists_obj(objects):
return [
obj for obj in objects
if not AccessPermission.exists(obj, permissions.ACCESS_TYPE_MODIFY, new_user)
]
@contextmanager
def grant(objects):
try:
for obj in objects:
# !!! grantee == grantor
AccessPermission.grant(obj, permissions.ACCESS_TYPE_MODIFY, new_user, new_user)
db.session.commit()
except Exception:
db.session.rollback()
raise
grant_dashboards()
The grantor is set to new_user, but there is no deep meaning. https://github.com/getredash/redash/blob/004bc7a2ac0de041907ab0b9b560151ea7057332/redash/models/users.py#L332
The query can also be realized by the same thing as described above.
Also, by enabling Enable experimental multiple owners support
from the settings (/ settings / organization
), you can grant permissions to the user from the query edit screen.