conditionally show groups option

This commit is contained in:
Kyle Spearrin 2017-05-09 20:35:18 -04:00
parent dce609d141
commit eb7fd4a015
2 changed files with 12 additions and 3 deletions

View File

@ -1,11 +1,20 @@
angular angular
.module('bit.organization') .module('bit.organization')
.controller('organizationPeopleController', function ($scope, $state, $uibModal, cryptoService, apiService, .controller('organizationPeopleController', function ($scope, $state, $uibModal, cryptoService, apiService, authService,
toastr, $analytics) { toastr, $analytics) {
$scope.users = []; $scope.users = [];
$scope.useGroups = false;
$scope.$on('$viewContentLoaded', function () { $scope.$on('$viewContentLoaded', function () {
loadList(); loadList();
authService.getUserProfile().then(function (profile) {
if (profile.organizations) {
var org = profile.organizations[$state.params.orgId];
$scope.useGroups = !!org.useGroups;
}
});
}); });
$scope.reinvite = function (user) { $scope.reinvite = function (user) {
@ -97,7 +106,7 @@
}); });
modal.result.then(function () { modal.result.then(function () {
}); });
}; };

View File

@ -42,7 +42,7 @@
</a> </a>
</li> </li>
<li> <li>
<a href="javascript:void(0)" ng-click="groups(user)"> <a href="javascript:void(0)" ng-click="groups(user)" ng-if="useGroups">
<i class="fa fa-fw fa-sitemap"></i> Groups <i class="fa fa-fw fa-sitemap"></i> Groups
</a> </a>
</li> </li>