Skip to content

Commit

Permalink
#1317 Hide mfa related columns in user admin if auth.multifactor.enab…
Browse files Browse the repository at this point in the history
…led = false
  • Loading branch information
nadouani committed May 24, 2020
1 parent 465041f commit 636d89f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions frontend/app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ angular.module('thehive', [
},
fields: function(CustomFieldsSrv){
return CustomFieldsSrv.all();
},
appConfig: function(VersionSrv) {
return VersionSrv.get();
}
},
permissions: ['manageOrganisation', 'manageUser', 'manageCaseTemplate']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
templateUrl: 'views/components/org/user.list.html',
bindings: {
users: '<',
mfaEnabled: '<',
onReload: '&',
onEdit: '&'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
'use strict';

angular.module('theHiveControllers').controller('OrgDetailsCtrl',
function($scope, $q, $uibModal, OrganisationSrv, NotificationSrv, UserSrv, organisation, users, templates, fields) {
function($scope, $q, $uibModal, OrganisationSrv, NotificationSrv, UserSrv, organisation, users, templates, fields, appConfig) {
var self = this;

this.org = organisation;
this.users = users;
this.templates = templates;
this.fields = fields;
this.canChangeMfa = appConfig.config.capabilities.indexOf('mfa') !== -1;

this.getUserInfo = UserSrv.getCache;

Expand Down
4 changes: 2 additions & 2 deletions frontend/app/views/components/org/user.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<th></th>
<th>Password</th>
<th>API Key</th>
<th class="text-center" style="width: 100px">MFA</th>
<th class="text-center" style="width: 100px" ng-if="$ctrl.mfaEnabled">MFA</th>
<th style="width: 180px"></th>
</tr>
</thead>
Expand Down Expand Up @@ -84,7 +84,7 @@ <h4 class="media-heading">
</div>
</span>
</td>
<td class="text-center">
<td class="text-center" ng-if="$ctrl.mfaEnabled">
<span ng-if="!user.hasMFA">
No
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h3 class="box-title">
</div>
</div>
</div>
<org-user-list users="$vm.users" on-reload="$vm.reloadUsers()" on-edit="$vm.showUserDialog(user)"></org-user-list>
<org-user-list users="$vm.users" on-reload="$vm.reloadUsers()" on-edit="$vm.showUserDialog(user)" mfa-enabled="$vm.canChangeMfa"></org-user-list>
</div>
</uib-tab>
<uib-tab index="1" if-permission="manageCaseTemplate">
Expand Down

0 comments on commit 636d89f

Please sign in to comment.