Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #1141 : saveAs plugin is displayed with user allowedRoles #1142

Merged
merged 1 commit into from
Oct 14, 2016

Conversation

MV88
Copy link
Contributor

@MV88 MV88 commented Oct 13, 2016

This fix is needed to allow the administrator to enable or disable saveAsPlugin for normal and admin users

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 80.551% when pulling d513656 on MV88:iss1141 into 4bde244 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.559% when pulling d513656 on MV88:iss1141 into 4bde244 on geosolutions-it:master.

@@ -46,6 +46,9 @@ module.exports = {
drawer: {
enabled: false,
menu: "1"
},
saveAs: {
allowedRoles: ["ADMIN", "USER"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid to add this to the default state of mapstore 2

@@ -172,7 +174,8 @@ module.exports = {
text: <Message msgId="saveAs"/>,
icon: <Glyphicon glyph="floppy-open"/>,
action: editMap.bind(null, {}),
selector: (state) => (state && state.security && state.security.user ? {} : { style: {display: "none"} })
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"} })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (state && state.controls && state.controls.saveAs && state.controls.saveAs.allowedRoles) {
 // filter by role
} else {
  /   check if the user is present
}

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 80.465% when pulling 7181f3d on MV88:iss1141 into 4bde244 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.559% when pulling 7181f3d on MV88:iss1141 into 4bde244 on geosolutions-it:master.

@offtherailz offtherailz merged commit d2e6630 into geosolutions-it:master Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants