Skip to content

Commit

Permalink
Admin Page: change default settings tab depending on your role (#13541)
Browse files Browse the repository at this point in the history
Editors shouldn't see the Security tab when they load wp-admin/admin.php?page=jetpack#/settings,
since they can't see anything on that tab. They should see the Writing tab instead, where they can use things like Post By Email.
  • Loading branch information
jeherve authored and kraftbj committed Sep 30, 2019
1 parent f65853a commit 0ba89d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions _inc/client/settings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export default class extends React.Component {
<Security
siteAdminUrl={ this.props.siteAdminUrl }
siteRawUrl={ this.props.siteRawUrl }
active={ '/security' === this.props.route.path || '/settings' === this.props.route.path }
active={
'/security' === this.props.route.path ||
( '/settings' === this.props.route.path && this.props.userCanManageModules )
}
{ ...commonProps }
/>
<Discussion
Expand All @@ -60,7 +63,10 @@ export default class extends React.Component {
/>
<Writing
siteAdminUrl={ this.props.siteAdminUrl }
active={ '/writing' === this.props.route.path }
active={
'/writing' === this.props.route.path ||
( '/settings' === this.props.route.path && ! this.props.userCanManageModules )
}
{ ...commonProps }
/>
<Sharing
Expand Down

0 comments on commit 0ba89d5

Please sign in to comment.