HUE-8792: [notebook] Error while share documents(user can save document with only read permissions)
Review Request #13800 — Created April 5, 2019 and submitted
Information | |
---|---|
mkysliuk | |
hue | |
Reviewers | |
hue | |
romain |
From f0d07aa9aad1fc6108b7d7838a49ce495b60c8b6 Mon Sep 17 00:00:00 2001
From: Mykhailo Kysliuk misha.kysliuk@gmail.com
Date: Fri, 5 Apr 2019 18:42:15 +0300
Subject: [PATCH] HUE-8792: [notebook] Error while share documents(user can
save document with only read permissions)https://issues.cloudera.org/browse/HUE-8792
https://github.com/cloudera/hue/pull/831
Manual on Chrome.
-
-
desktop/libs/notebook/src/notebook/decorators.py (Diff revision 1) Looking back at this, is there a reason why we wouldn't just check for the presence of parentSavedQueryUuid instead of checking isHistory?
e.g.
Document2.objects.get(uuid=notebook['parentSavedQueryUuid']) if notebook.get('parentSavedQueryUuid') else \
Document2.objects.get(id=notebook['id'])Let's create a method for this check and reuse here:
https://github.com/cloudera/hue/blob/ca2ea6c5e3979b963b151931ac4a689f69131b54/desktop/libs/notebook/src/notebook/api.py#L336
-
I would need to think a bit more as tricky but important, but the good behavior could be to offer the 'save as', like a read only query can be 'saved as'?
Here is might be an issue with the save method too https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/api.py#L336 (if not W perm on parent document, we go in the save as)