You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/06/02 10:25:19 UTC

[GitHub] [superset] sujeetpillai commented on a change in pull request #14741: fix: Additional ResultSet tests

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;`
   
   




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org