-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding permission for can_only_access_owned_queries #7234
Adding permission for can_only_access_owned_queries #7234
Conversation
5af6617
to
c036ba6
Compare
e359071
to
263972b
Compare
263972b
to
94968ad
Compare
Codecov Report
@@ Coverage Diff @@
## master #7234 +/- ##
==========================================
+ Coverage 64.62% 64.94% +0.31%
==========================================
Files 422 424 +2
Lines 20593 20598 +5
Branches 2253 2281 +28
==========================================
+ Hits 13309 13378 +69
+ Misses 7161 7097 -64
Partials 123 123
Continue to review full report at Codecov.
|
@mistercrunch to confirm you mean in Whenever I do this the permissions get removed whenever the app starts I'm guessing because of something that |
It looks like Flask App Builder goes through and cleans up permissions on view menus (other than can_add, can_edit,...) so I'm not sure it's possible for me to add |
Ok I didn't know it would do that. LGMT |
SUMMARY
Adding an optional restriction on query search to only allow users to access their own queries. Right now query search lets anyone access any queries. That would be the default for all roles, but if a deployment wanted to change to restrict users to only search their queries they could do that with the can_only_access_owned_queries permission.
With can_only_access_owned_queries in OBJECT_SPEC_PERMISSIONS, this permission is not added to any role by default.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
Run superset init with new can_only_access_owned_queries default off in OBJECT_SPEC_PERMISSIONS
Logged in as user1 and ran query
Logged in as user2 and confirmed that I could see all queries queries in
/superset/sqllab#search
and/queryview/list/
Moved perm can_only_access_owned_queries to ADMIN_ONLY_PERMISSIONS
Run superset init
Confirmed that as user2 I could see only my queries queries in
/superset/sqllab#search
and/queryview/list/
ADDITIONAL INFORMATION
REVIEWERS
@mistercrunch @john-bodley