Skip to content

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

Merged
offtherailz merged 1 commit into
geosolutions-it:masterfrom
MV88:iss1141
Oct 14, 2016
Merged

fixed #1141 : saveAs plugin is displayed with user allowedRoles#1142
offtherailz merged 1 commit into
geosolutions-it:masterfrom
MV88:iss1141

Conversation

@MV88

@MV88 MV88 commented Oct 13, 2016

Copy link
Copy Markdown
Contributor

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

@coveralls

Copy link
Copy Markdown

Coverage Status

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

@coveralls

Copy link
Copy Markdown

Coverage Status

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

Comment thread web/client/product/appConfig.js Outdated
menu: "1"
},
saveAs: {
allowedRoles: ["ADMIN", "USER"]

Copy link
Copy Markdown
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

Comment thread web/client/plugins/SaveAs.jsx Outdated
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
Copy Markdown
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
Copy Markdown

Coverage Status

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

@coveralls

Copy link
Copy Markdown

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