mistercrunch commented on issue #2148: Impersonate database user when running 
queries
URL: 
https://github.com/apache/incubator-superset/issues/2148#issuecomment-321735711
 
 
   Actually looks like it may be possible by just using a different connection 
string as in `create_engine('presto://user@host:443/hive')`. Would you assume 
that the superset username matches the presto username?
   
   You'd want to add a configuration Boolean column `impersonate_user` to the 
Database model 
https://github.com/apache/incubator-superset/blob/master/superset/models/core.py#L526,
 along with a db migration script.
   
   Then it would be a matter of changing there user here:
   
https://github.com/apache/incubator-superset/blob/master/superset/models/core.py#L580
   something like 
   ```
   if self.impersonate_user:
       uri.user = g.user.username
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to