diff --git a/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js b/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js index 4240901b9..d2936e7b9 100644 --- a/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js +++ b/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js @@ -117,6 +117,15 @@ angular.module('manage').directive('identifierSetEditor', ['$injector', */ $scope.identifierFlags = {}; + /** + * Map of identifiers to boolean flags indicating whether that + * identifier is editable. If an identifier is not editable, it will be + * absent from this map. + * + * @type Object. + */ + $scope.isEditable = {}; + /** * Adds the given identifier to the given sorted array of identifiers, * preserving the sorted order of the array. If the identifier is @@ -194,6 +203,16 @@ angular.module('manage').directive('identifierSetEditor', ['$injector', }); + // An identifier is editable iff it is available to be added or removed + // from the identifier set being edited (iff it is within the + // identifiersAvailable array) + $scope.$watch('identifiersAvailable', function availableIdentifiersChanged(identifiers) { + $scope.isEditable = {}; + angular.forEach(identifiers, function storeEditableIdentifier(identifier) { + $scope.isEditable[identifier] = true; + }); + }); + /** * Notifies the controller that a change has been made to the flag * denoting presence/absence of a particular identifier within the diff --git a/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html b/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html index 7f660883d..72c235c66 100644 --- a/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html +++ b/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html @@ -18,7 +18,8 @@