Ensure we render a useful string for access restriction users
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
<label class="control-label">User</label>
|
||||
<p>
|
||||
This is a single user application.<br/><br/>
|
||||
Access is granted to <b>{{appConfigure.app.accessRestriction.users[0]}}</b>.
|
||||
Access is granted to <b>{{ renderAccessRestrictionUser(appConfigure.app.accessRestriction.users[0]) }}</b>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-hide="appConfigure.app.manifest.singleUser">
|
||||
|
||||
@@ -408,6 +408,15 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
|
||||
});
|
||||
};
|
||||
|
||||
$scope.renderAccessRestrictionUser = function (userId) {
|
||||
var user = $scope.users.filter(function (u) { return u.id === userId; })[0];
|
||||
|
||||
// user not found
|
||||
if (!user) return userId;
|
||||
|
||||
return user.username ? user.username : user.email;
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
window.history.back();
|
||||
};
|
||||
@@ -434,10 +443,14 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
|
||||
});
|
||||
}
|
||||
|
||||
if ($scope.user.admin) {
|
||||
fetchUsers();
|
||||
fetchGroups();
|
||||
}
|
||||
Client.refreshUserInfo(function (error) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
if ($scope.user.admin) {
|
||||
fetchUsers();
|
||||
fetchGroups();
|
||||
}
|
||||
});
|
||||
|
||||
// setup all the dialog focus handling
|
||||
['appConfigureModal', 'appUninstallModal', 'appUpdateModal', 'appRestoreModal'].forEach(function (id) {
|
||||
|
||||
Reference in New Issue
Block a user