diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js b/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js index 868842eaf..856220767 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js @@ -299,6 +299,23 @@ angular.module('manage').controller('manageConnectionController', ['$scope', '$i $scope.parameters = {}; } + /** + * Returns whether the current user can change/set all connection + * attributes for the connection being edited, regardless of whether those + * attributes are already explicitly associated with that connection. + * + * @returns {Boolean} + * true if the current user can change all attributes for the + * connection being edited, regardless of whether those attributes are + * already explicitly associated with that connection, false otherwise. + */ + $scope.canChangeAllAttributes = function canChangeAllAttributes() { + + // All attributes can be set if we are creating the connection + return !identifier; + + }; + /** * Returns the translation string namespace for the protocol having the * given name. The namespace will be of the form: diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageConnectionGroupController.js b/guacamole/src/main/webapp/app/manage/controllers/manageConnectionGroupController.js index e4c61156f..bafe5912c 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageConnectionGroupController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageConnectionGroupController.js @@ -195,7 +195,26 @@ angular.module('manage').controller('manageConnectionGroupController', ['$scope' value : ConnectionGroup.Type.BALANCING } ]; - + + /** + * Returns whether the current user can change/set all connection group + * attributes for the connection group being edited, regardless of whether + * those attributes are already explicitly associated with that connection + * group. + * + * @returns {Boolean} + * true if the current user can change all attributes for the + * connection group being edited, regardless of whether those + * attributes are already explicitly associated with that connection + * group, false otherwise. + */ + $scope.canChangeAllAttributes = function canChangeAllAttributes() { + + // All attributes can be set if we are creating the connection group + return !identifier; + + }; + /** * Cancels all pending edits, returning to the management page. */ diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js b/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js index ca7d11e9a..c5329750e 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js @@ -280,6 +280,25 @@ angular.module('manage').controller('manageSharingProfileController', ['$scope', }); + /** + * Returns whether the current user can change/set all sharing profile + * attributes for the sharing profile being edited, regardless of whether + * those attributes are already explicitly associated with that sharing + * profile. + * + * @returns {Boolean} + * true if the current user can change all attributes for the sharing + * profile being edited, regardless of whether those attributes are + * already explicitly associated with that sharing profile, false + * otherwise. + */ + $scope.canChangeAllAttributes = function canChangeAllAttributes() { + + // All attributes can be set if we are creating the sharing profile + return !identifier; + + }; + /** * Returns the translation string namespace for the protocol having the * given name. The namespace will be of the form: diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js index 5337caf01..7f50e434d 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js @@ -225,8 +225,8 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto }; /** - * Returns whether the current user can change attributes associated with - * the user being edited within the given data source. + * Returns whether the current user can change attributes explicitly + * associated with the user being edited within the given data source. * * @param {String} [dataSource] * The identifier of the data source to check. If omitted, this will @@ -260,6 +260,23 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto }; + /** + * Returns whether the current user can change/set all user attributes for + * the user being edited, regardless of whether those attributes are + * already explicitly associated with that user. + * + * @returns {Boolean} + * true if the current user can change all attributes for the user + * being edited, regardless of whether those attributes are already + * explicitly associated with that user, false otherwise. + */ + $scope.canChangeAllAttributes = function canChangeAllAttributes() { + + // All attributes can be set if we are creating the user + return !$scope.userExists(selectedDataSource); + + }; + /** * Returns whether the current user can change permissions of any kind * which are associated with the user being edited within the given data diff --git a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html index 80796a4c9..85e4f917e 100644 --- a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html +++ b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html @@ -41,7 +41,7 @@