Skip to content

Commit

Permalink
Prevent OC from seeing the download interface, fix audit issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonesy committed Feb 11, 2020
1 parent 033ca10 commit 27686ec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
20 changes: 10 additions & 10 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"jest-websocket-mock": "^2.0.0",
"mini-css-extract-plugin": "^0.4.4",
"mock-socket": "^9.0.2",
"node-sass": "^4.13.0",
"node-sass": "^4.13.1",
"nodemon": "^1.18.11",
"prettier": "^1.18.2",
"redux-logger": "^3.0.6",
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/modules/app/components/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class App extends React.Component {
zone,
};

if (!hasValidGroupAccess) {
// Don't let OC's to download or invalid group access
if ((hasOcRole && exporterMode === 'download') || !hasValidGroupAccess) {
return <Unauthorized />;
}

Expand All @@ -81,7 +82,7 @@ class App extends React.Component {
el = <Reports />;
} else if (hasOcRole && !hasExporterRole) {
el = <OutputChecker {...props} />;
} else {
} else if (hasExporterRole) {
el = <Exporter {...props} />;
}
} else if (authFetchStatus === 'loaded') {
Expand Down Expand Up @@ -118,6 +119,7 @@ App.propTypes = {
initSockets: PropTypes.func.isRequired,
isAuthenticated: PropTypes.bool.isRequired,
user: PropTypes.shape({
groups: PropTypes.arrayOf(PropTypes.string),
displayName: PropTypes.string,
}).isRequired,
zone: PropTypes.string.isRequired,
Expand Down

0 comments on commit 27686ec

Please sign in to comment.