sujeetpillai commented on a change in pull request #14741:
URL: https://github.com/apache/superset/pull/14741#discussion_r643826750



##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -526,34 +526,32 @@ export default class ResultSet extends 
React.PureComponent<
     const { results, rows, queryLimit, limitingFactor } = this.props.query;
     let limitMessage;
     const limitReached = results?.displayLimitReached;
-    const isAdmin = !!this.props.user?.roles.Admin;
     const limit = queryLimit || results.query.limit;
+    const isAdmin = !!this.props.user?.roles.Admin;

Review comment:
       I'm getting an error in SQLLab here if the this.props.user.roles is 
undefined. Changing this code to the below fixes the issue. If roles is 
undefined assume it's not admin. I'm not sure why roles wouldn't be populated 
though. I was logged in as an Administrator.
   
   `const isAdmin = !!this.props.user?.roles?.Admin;`
   
   Since this is only used to change the display message, I don't think the 
above fix will break any functionality.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to