 T120.permission AS "Permission (Next Gen Perm)"
 FROM
 next_gen_permissions T120
-LEFT JOIN workbooks T301 ON T120.authorizable_id = T301.id AND next_gen_permissions.authorizable_type = 'Workbook'
-LEFT JOIN projects T227 ON T120.authorizable_id = T227.id AND next_gen_permissions.authorizable_type = 'Project'
-LEFT JOIN views T297 ON T120.authorizable_id = T297.id AND next_gen_permissions.authorizable_type = 'View'
-LEFT JOIN datasources T55 ON T120.authorizable_id = T55.id AND next_gen_permissions.authorizable_type = 'Datasource'
-LEFT JOIN users T290 ON T120.grantee_id = T290.id AND next_gen_permissions.next_gen_permissions.grantee_type = 'User'
-LEFT JOIN groups T78 ON T120.grantee_id = T78.id AND next_gen_permissions.next_gen_permissions.grantee_type = 'Group'
+LEFT JOIN workbooks T301 ON T120.authorizable_id = T301.id AND T120.authorizable_type = 'Workbook'
+LEFT JOIN projects T227 ON T120.authorizable_id = T227.id AND T120.authorizable_type = 'Project'
+LEFT JOIN views T297 ON T120.authorizable_id = T297.id AND T120.authorizable_type = 'View'
+LEFT JOIN datasources T55 ON T120.authorizable_id = T55.id AND T120.authorizable_type = 'Datasource'
+LEFT JOIN users T290 ON T120.grantee_id = T290.id AND T120.T120.grantee_type = 'User'
+LEFT JOIN groups T78 ON T120.grantee_id = T78.id AND T120.T120.grantee_type = 'Group'
 INNER JOIN capabilities T30 ON T120.capability_id = T30.id
 ---------------------------------------------------
 -- Table oauth_request_tokens

INNER JOIN data_alerts T47 ON T297.id = T47.view_id
LEFT JOIN hist_views T92 ON T297.id = T92.view_id
INNER JOIN http_requests T97 ON T297.view_url = T97.currentsheet
LEFT JOIN next_gen_permissions T120 ON T297.id = T120.authorizable_id AND next_gen_permissions.authorizable_type = 'View'
INNER JOIN sheet_images T251 ON T297.id = T251.view_id
INNER JOIN user_default_customized_views T284 ON T297.id = T284.view_id
INNER JOIN view_metrics_aggregations T293 ON T297.id = T293.view_id

projects T227
INNER JOIN datasources T55 ON T227.id = T55.project_id
LEFT JOIN hist_projects T86 ON T227.id = T86.project_id
LEFT JOIN next_gen_permissions T120 ON T227.id = T120.authorizable_id AND T120.authorizable_type = 'Project'
INNER JOIN permissions_templates T126 ON T227.id = T126.project_id
INNER JOIN users T290 ON T227.owner_id = T290.id
INNER JOIN sites T259 ON T227.site_id = T259.id
