Skip to content

Commit

Permalink
if no allowed roles is provided it checks only if a user is logged
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Oct 13, 2016
1 parent d513656 commit b10424a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 6 additions & 2 deletions web/client/plugins/SaveAs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ module.exports = {
text: <Message msgId="saveAs"/>,
icon: <Glyphicon glyph="floppy-open"/>,
action: editMap.bind(null, {}),
selector: (state) => (
indexOf(state && state.controls && state.controls.saveAs && state.controls.saveAs.allowedRoles, state && state.security && state.security.user && state.security.user.role) !== -1 ? {} : { style: {display: "none"} })
selector: (state) => {
if (state && state.controls && state.controls.saveAs && state.controls.saveAs.allowedRoles) {
return indexOf(state.controls.saveAs.allowedRoles, state && state.security && state.security.user && state.security.user.role) !== -1 ? {} : { style: {display: "none"} };
}
return state && state.security && state.security.user ? {} : { style: {display: "none"} };
}
}
}))
};
3 changes: 0 additions & 3 deletions web/client/product/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ module.exports = {
drawer: {
enabled: false,
menu: "1"
},
saveAs: {
allowedRoles: ["ADMIN", "USER"]
}
}
},
Expand Down

0 comments on commit b10424a

Please sign in to comment.