GUACAMOLE-292: Display all object attributes if we are creating the object.

This commit is contained in:
Michael Jumper
2017-05-21 20:14:11 -07:00
parent 54a3ffeae3
commit 74293c23dd
8 changed files with 79 additions and 7 deletions

View File

@@ -299,6 +299,23 @@ angular.module('manage').controller('manageConnectionController', ['$scope', '$i
$scope.parameters = {}; $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 * Returns the translation string namespace for the protocol having the
* given name. The namespace will be of the form: * given name. The namespace will be of the form:

View File

@@ -195,7 +195,26 @@ angular.module('manage').controller('manageConnectionGroupController', ['$scope'
value : ConnectionGroup.Type.BALANCING 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. * Cancels all pending edits, returning to the management page.
*/ */

View File

@@ -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 * Returns the translation string namespace for the protocol having the
* given name. The namespace will be of the form: * given name. The namespace will be of the form:

View File

@@ -225,8 +225,8 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto
}; };
/** /**
* Returns whether the current user can change attributes associated with * Returns whether the current user can change attributes explicitly
* the user being edited within the given data source. * associated with the user being edited within the given data source.
* *
* @param {String} [dataSource] * @param {String} [dataSource]
* The identifier of the data source to check. If omitted, this will * 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 * Returns whether the current user can change permissions of any kind
* which are associated with the user being edited within the given data * which are associated with the user being edited within the given data

View File

@@ -41,7 +41,7 @@
<!-- Connection attributes section --> <!-- Connection attributes section -->
<div class="attributes"> <div class="attributes">
<guac-form namespace="'CONNECTION_ATTRIBUTES'" content="attributes" <guac-form namespace="'CONNECTION_ATTRIBUTES'" content="attributes"
model="connection.attributes" model-only="true"></guac-form> model="connection.attributes" model-only="!canChangeAllAttributes()"></guac-form>
</div> </div>
<!-- Connection parameters --> <!-- Connection parameters -->

View File

@@ -41,7 +41,7 @@
<!-- Connection group attributes section --> <!-- Connection group attributes section -->
<div class="attributes"> <div class="attributes">
<guac-form namespace="'CONNECTION_GROUP_ATTRIBUTES'" content="attributes" <guac-form namespace="'CONNECTION_GROUP_ATTRIBUTES'" content="attributes"
model="connectionGroup.attributes" model-only="true"></guac-form> model="connectionGroup.attributes" model-only="!canChangeAllAttributes()"></guac-form>
</div> </div>
<!-- Form action buttons --> <!-- Form action buttons -->

View File

@@ -22,7 +22,7 @@
<!-- Sharing profile attributes section --> <!-- Sharing profile attributes section -->
<div class="attributes"> <div class="attributes">
<guac-form namespace="'SHARING_PROFILE_ATTRIBUTES'" content="attributes" <guac-form namespace="'SHARING_PROFILE_ATTRIBUTES'" content="attributes"
model="sharingProfile.attributes" model-only="true"></guac-form> model="sharingProfile.attributes" model-only="!canChangeAllAttributes()"></guac-form>
</div> </div>
<!-- Sharing profile parameters --> <!-- Sharing profile parameters -->

View File

@@ -42,7 +42,7 @@
<!-- User attributes section --> <!-- User attributes section -->
<div class="attributes" ng-show="canChangeAttributes()"> <div class="attributes" ng-show="canChangeAttributes()">
<guac-form namespace="'USER_ATTRIBUTES'" content="attributes" <guac-form namespace="'USER_ATTRIBUTES'" content="attributes"
model="user.attributes" model-only="true"></guac-form> model="user.attributes" model-only="!canChangeAllAttributes()"></guac-form>
</div> </div>
<!-- System permissions section --> <!-- System permissions section -->