Skip to content

Commit

Permalink
don't allow the normal People admin actions to be enabled on oneself.
Browse files Browse the repository at this point in the history
  • Loading branch information
agilliland committed Jun 14, 2016
1 parent 3c80025 commit 6a92970
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions frontend/src/metabase/admin/people/components/AdminPeople.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class AdminPeople extends Component {

static propTypes = {
dispatch: PropTypes.func.isRequired,
users: PropTypes.array
users: PropTypes.object
};

async componentDidMount() {
Expand Down Expand Up @@ -382,7 +382,9 @@ export default class AdminPeople extends Component {
</td>
<td>{ user.last_login ? user.last_login.fromNow() : "Never" }</td>
<td className="text-right">
<UserActionsSelect user={user} dispatch={this.props.dispatch} />
{ this.props.user.id !== user.id &&
<UserActionsSelect user={user} dispatch={this.props.dispatch} />
}
</td>
</tr>
)}
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/metabase/admin/people/people.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ var AdminPeople = angular.module('metabase.admin.people', [
AdminPeople.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/admin/people/', {
template: '<div mb-redux-component class="flex flex-column flex-full" />',
controller: 'PeopleList'
controller: 'PeopleList',
resolve: {
appState: ["AppState", function(AppState) {
return AppState.init();
}]
}
});
}]);

0 comments on commit 6a92970

Please sign in to comment.