mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUAC-932: Add permissions list.
This commit is contained in:
		| @@ -25,7 +25,9 @@ | ||||
|  | ||||
|         <!-- Connection --> | ||||
|         <div class="connection" ng-show="item.isConnection"> | ||||
|             <ng-include src="connectionTemplate"/> | ||||
|             <div class="caption"> | ||||
|                 <ng-include src="connectionTemplate"/> | ||||
|             </div> | ||||
|         </div> | ||||
|  | ||||
|         <!-- Connection group --> | ||||
|   | ||||
| @@ -73,6 +73,10 @@ div.recent-connections .protocol { | ||||
|     vertical-align: middle; | ||||
| } | ||||
|  | ||||
| .caption > * { | ||||
|     display: inline-block; | ||||
| } | ||||
|  | ||||
| .caption .name { | ||||
|     margin-left: 0.25em; | ||||
| } | ||||
|   | ||||
| @@ -72,8 +72,8 @@ h2 ~ h2 { | ||||
| } | ||||
|  | ||||
| div.section { | ||||
|     margin: 0; | ||||
|     padding: 1em; | ||||
|     margin: 1em; | ||||
|     padding: 0; | ||||
| } | ||||
|  | ||||
| /* | ||||
|   | ||||
| @@ -55,7 +55,7 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', | ||||
|      */ | ||||
|     $scope.newUsername = ""; | ||||
|      | ||||
|     // Retrieve all users for whom we have UPDATE permission | ||||
|     // Retrieve all connections for which we have UPDATE permission | ||||
|     connectionGroupService.getConnectionGroupTree(ConnectionGroup.ROOT_IDENTIFIER, PermissionSet.ObjectPermissionType.UPDATE) | ||||
|     .success(function connectionGroupReceived(rootGroup) { | ||||
|         $scope.rootGroup = rootGroup; | ||||
|   | ||||
| @@ -26,11 +26,16 @@ | ||||
| angular.module('manage').controller('manageUserController', ['$scope', '$injector',  | ||||
|         function manageUserController($scope, $injector) { | ||||
|              | ||||
|     // Required types | ||||
|     var ConnectionGroup = $injector.get('ConnectionGroup'); | ||||
|     var PermissionSet   = $injector.get('PermissionSet'); | ||||
|  | ||||
|     // Required services | ||||
|     var $location         = $injector.get('$location'); | ||||
|     var $routeParams      = $injector.get('$routeParams'); | ||||
|     var userService       = $injector.get('userService'); | ||||
|     var permissionService = $injector.get('permissionService'); | ||||
|     var $location              = $injector.get('$location'); | ||||
|     var $routeParams           = $injector.get('$routeParams'); | ||||
|     var connectionGroupService = $injector.get('connectionGroupService'); | ||||
|     var userService            = $injector.get('userService'); | ||||
|     var permissionService      = $injector.get('permissionService'); | ||||
|  | ||||
|     /** | ||||
|      * An action to be provided along with the object sent to showStatus which | ||||
| @@ -61,7 +66,13 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto | ||||
|         $scope.permissions = permissions; | ||||
|     }); | ||||
|  | ||||
|      /** | ||||
|     // Retrieve all connections for which we have UPDATE permission | ||||
|     connectionGroupService.getConnectionGroupTree(ConnectionGroup.ROOT_IDENTIFIER, PermissionSet.ObjectPermissionType.ADMINISTER) | ||||
|     .success(function connectionGroupReceived(rootGroup) { | ||||
|         $scope.rootGroup = rootGroup; | ||||
|     }); | ||||
|  | ||||
|     /** | ||||
|      * Cancels all pending edits, returning to the management page. | ||||
|      */ | ||||
|     $scope.cancel = function cancel() { | ||||
|   | ||||
| @@ -1,35 +0,0 @@ | ||||
| /* | ||||
|  * Copyright (C) 2014 Glyptodon LLC | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|  * of this software and associated documentation files (the "Software"), to deal | ||||
|  * in the Software without restriction, including without limitation the rights | ||||
|  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|  * copies of the Software, and to permit persons to whom the Software is | ||||
|  * furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included in | ||||
|  * all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
|  * THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /** | ||||
|  * A modal for editing a connection group. | ||||
|  */ | ||||
| angular.module('manage').factory('connectionGroupEditModal', ['btfModal',  | ||||
|         function connectionGroupEditModal(btfModal) { | ||||
|              | ||||
|     // Create the modal object to be used later to actually create the modal | ||||
|     return btfModal({ | ||||
|         controller: 'connectionGroupEditModalController', | ||||
|         controllerAs: 'modal', | ||||
|         templateUrl: 'app/manage/templates/editableConnectionGroup.html', | ||||
|     }); | ||||
| }]); | ||||
| @@ -1,35 +0,0 @@ | ||||
| /* | ||||
|  * Copyright (C) 2014 Glyptodon LLC | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|  * of this software and associated documentation files (the "Software"), to deal | ||||
|  * in the Software without restriction, including without limitation the rights | ||||
|  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|  * copies of the Software, and to permit persons to whom the Software is | ||||
|  * furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included in | ||||
|  * all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
|  * THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /** | ||||
|  * A modal for editing a connection. | ||||
|  */ | ||||
| angular.module('manage').factory('userEditModal', ['btfModal',  | ||||
|         function userEditModal(btfModal) { | ||||
|              | ||||
|     // Create the modal object to be used later to actually create the modal | ||||
|     return btfModal({ | ||||
|         controller: 'userEditModalController', | ||||
|         controllerAs: 'modal', | ||||
|         templateUrl: 'app/manage/templates/editableUser.html', | ||||
|     }); | ||||
| }]); | ||||
| @@ -20,11 +20,7 @@ | ||||
|  * THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| .manage .properties table { | ||||
|     margin: 1em; | ||||
| } | ||||
|  | ||||
| .manage .properties table th { | ||||
| .manage table.properties th { | ||||
|     text-align: left; | ||||
|     font-weight: normal; | ||||
|     padding-right: 1em; | ||||
|   | ||||
| @@ -21,15 +21,12 @@ | ||||
|        THE SOFTWARE. | ||||
|     --> | ||||
|  | ||||
|     <div class="caption"> | ||||
|  | ||||
|         <!-- Connection icon --> | ||||
|         <div class="protocol"> | ||||
|             <div class="icon type" ng-class="item.protocol"></div> | ||||
|         </div> | ||||
|  | ||||
|         <!-- Connection name --> | ||||
|         <span class="name">{{item.name}}</span> | ||||
|  | ||||
|     <!-- Connection icon --> | ||||
|     <div class="protocol"> | ||||
|         <div class="icon type" ng-class="item.protocol"></div> | ||||
|     </div> | ||||
|  | ||||
|     <!-- Connection name --> | ||||
|     <span class="name">{{item.name}}</span> | ||||
|  | ||||
| </a> | ||||
|   | ||||
| @@ -21,5 +21,5 @@ | ||||
|        THE SOFTWARE. | ||||
|     --> | ||||
|  | ||||
|     {{item.name}} | ||||
|     <span class="name">{{item.name}}</span> | ||||
| </a> | ||||
|   | ||||
| @@ -0,0 +1,26 @@ | ||||
| <div class="choice"> | ||||
|     <!-- | ||||
|        Copyright (C) 2014 Glyptodon LLC | ||||
|  | ||||
|        Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|        of this software and associated documentation files (the "Software"), to deal | ||||
|        in the Software without restriction, including without limitation the rights | ||||
|        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|        copies of the Software, and to permit persons to whom the Software is | ||||
|        furnished to do so, subject to the following conditions: | ||||
|  | ||||
|        The above copyright notice and this permission notice shall be included in | ||||
|        all copies or substantial portions of the Software. | ||||
|  | ||||
|        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
|        THE SOFTWARE. | ||||
|     --> | ||||
|  | ||||
|     <input type="checkbox" ng-model="connectionPermissions[item.identifier]" ng-change="markConnectionPermissionModified(item.identifier)"/> | ||||
|     <span class="name">{{item.name}}</span> | ||||
| </div> | ||||
| @@ -0,0 +1,35 @@ | ||||
| <div class="choice"> | ||||
|     <!-- | ||||
|        Copyright (C) 2014 Glyptodon LLC | ||||
|  | ||||
|        Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|        of this software and associated documentation files (the "Software"), to deal | ||||
|        in the Software without restriction, including without limitation the rights | ||||
|        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|        copies of the Software, and to permit persons to whom the Software is | ||||
|        furnished to do so, subject to the following conditions: | ||||
|  | ||||
|        The above copyright notice and this permission notice shall be included in | ||||
|        all copies or substantial portions of the Software. | ||||
|  | ||||
|        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
|        THE SOFTWARE. | ||||
|     --> | ||||
|  | ||||
|     <!-- Connection icon --> | ||||
|     <div class="protocol"> | ||||
|         <div class="icon type" ng-class="item.protocol"></div> | ||||
|     </div> | ||||
|  | ||||
|     <!-- Checkbox --> | ||||
|     <input type="checkbox" ng-model="connectionPermissions[item.identifier]" ng-change="markConnectionPermissionModified(item.identifier)"/> | ||||
|  | ||||
|     <!-- Connection name --> | ||||
|     <span class="name">{{item.name}}</span> | ||||
|  | ||||
| </div> | ||||
| @@ -27,8 +27,8 @@ THE SOFTWARE. | ||||
|  | ||||
| <!-- Main property editor --> | ||||
| <h2>{{'manage.edit.connection.title' | translate}}</h2> | ||||
| <div class="properties"> | ||||
|         <table> | ||||
| <div class="section"> | ||||
|     <table class="properties"> | ||||
|          | ||||
|         <!-- Edit connection name --> | ||||
|         <tr> | ||||
| @@ -59,8 +59,8 @@ THE SOFTWARE. | ||||
|  | ||||
| <!-- Connection parameters --> | ||||
| <h2>{{'manage.edit.connection.parameters' | translate}}</h2> | ||||
| <div class="properties" ng-class="{loading: !parameters}"> | ||||
|     <table class="fields"> | ||||
| <div class="section" ng-class="{loading: !parameters}"> | ||||
|     <table class="properties"> | ||||
|          | ||||
|         <!-- All the different possible editable field types --> | ||||
|         <tr ng-repeat="parameter in protocols[connection.protocol].parameters"> | ||||
| @@ -81,7 +81,7 @@ THE SOFTWARE. | ||||
|  | ||||
| <!-- Connection history --> | ||||
| <h2>{{'manage.edit.connection.history.usageHistory' | translate}}</h2> | ||||
| <div class="history" ng-class="{loading: !historyEntryWrappers}"> | ||||
| <div class="history section" ng-class="{loading: !historyEntryWrappers}"> | ||||
|     <p ng-hide="historyEntryWrappers.length">{{'manage.edit.connection.history.connectionNotUsed' | translate}}</p> | ||||
|     <table ng-show="historyEntryWrappers.length"> | ||||
|         <thead> | ||||
|   | ||||
| @@ -27,8 +27,8 @@ THE SOFTWARE. | ||||
|  | ||||
| <!-- Main property editor --> | ||||
| <h2>{{'manage.edit.connectionGroup.title' | translate}}</h2> | ||||
| <div class="properties"> | ||||
|     <table> | ||||
| <div class="section"> | ||||
|     <table class="properties"> | ||||
|                      | ||||
|         <!-- Edit connection group name --> | ||||
|         <tr> | ||||
|   | ||||
| @@ -20,41 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
| THE SOFTWARE. | ||||
| --> | ||||
|  | ||||
| <!-- Hierarchical connection and connection group permission selector --> | ||||
| <script type="text/ng-template" id="nestedUserPermissionEditGroup.html"> | ||||
|      | ||||
|     <!-- Connection --> | ||||
|     <div class="choice" ng-show="item.isConnection"> | ||||
|       <input type="checkbox" ng-model="connectionPermissions[item.identifier]" ng-change="markConnectionPermissionModified(item.identifier)"/> | ||||
|       <div class="connection list-item"> | ||||
|         <div class="caption"> | ||||
|           <div class="protocol"> | ||||
|             <div class="icon" ng-class="item.protocol"></div> | ||||
|           </div><span class="name">{{item.name}}</span> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|      | ||||
|     <!-- Connection group --> | ||||
|     <div class="choice" ng-show="!item.isConnection"> | ||||
|       <input type="checkbox" ng-model="connectionGroupPermissions[item.identifier]" ng-change="markConnectionGroupPermissionModified(item.identifier)"/> | ||||
|  | ||||
|       <div class="group empty list-item balancer"> | ||||
|         <div class="caption"> | ||||
|           <div class="icon group" ng-click="toggleExpanded(item)" ng-class="{expanded: item.expanded, empty: !item.children.length, balancer: item.balancer && !item.children.length}"></div> | ||||
|  | ||||
|           <span class="name">{{item.name}}</span> | ||||
|         </div> | ||||
|  | ||||
|         <!-- Connection group children --> | ||||
|         <div class="children" ng-show="item.expanded"> | ||||
|             <div ng-repeat="item in item.children | orderBy : 'name'" ng-include="'nestedUserPermissionEditGroup.html'"> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <div class="logout-panel"> | ||||
|     <a class="back button" href="#/manage/">{{'manage.back' | translate}}</a> | ||||
|     <a class="logout button" ng-click="logout()">{{'home.logout' | translate}}</a> | ||||
| @@ -62,8 +27,8 @@ THE SOFTWARE. | ||||
|  | ||||
| <!-- Main property editor --> | ||||
| <h2>{{'manage.edit.user.title' | translate}}</h2> | ||||
| <div class="properties"> | ||||
|     <table> | ||||
| <div class="section"> | ||||
|     <table class="properties"> | ||||
|         <tr> | ||||
|             <th>{{'manage.edit.user.username' | translate}}</th> | ||||
|                        | ||||
| @@ -84,8 +49,8 @@ THE SOFTWARE. | ||||
|  | ||||
| <!-- System permissions section --> | ||||
| <h2>{{'manage.edit.user.permissions' | translate}}</h2> | ||||
| <div class="properties"> | ||||
|     <table> | ||||
| <div class="section"> | ||||
|     <table class="properties"> | ||||
|         <tr> | ||||
|             <th>{{'manage.edit.user.administerSystem' | translate}}</th> | ||||
|                          | ||||
| @@ -114,12 +79,12 @@ THE SOFTWARE. | ||||
|      | ||||
| <!-- Connection and connection group permission section --> | ||||
| <h2>{{'manage.edit.user.connections' | translate}}</h2> | ||||
| <div> | ||||
|     <div class="group-view"> | ||||
|         <div class="list"> | ||||
|             <div ng-repeat="item in rootGroup.children | orderBy : 'name'" ng-include="'nestedUserPermissionEditGroup.html'"></div> | ||||
|         </div> | ||||
|     </div> | ||||
| <div class="section" ng-class="{loading: !rootGroup}"> | ||||
|     <guac-group-list | ||||
|         context="groupListContext" | ||||
|         connection-group="rootGroup" | ||||
|         connection-template="'app/manage/templates/connectionPermission.html'" | ||||
|         connection-group-template="'app/manage/templates/connectionGroupPermission.html'"/> | ||||
| </div> | ||||
|  | ||||
| <!-- Form action buttons --> | ||||
|   | ||||
| @@ -91,17 +91,16 @@ | ||||
|                     "title"             : "Delete User", | ||||
|                     "text"              : "Users cannot be restored after they have been deleted. Are you sure you want to delete this user?" | ||||
|                 }, | ||||
|                 "properties"                : "Properties:", | ||||
|                 "password"                  : "Password:", | ||||
|                 "passwordMatch"             : "Re-enter Password:", | ||||
|                 "passwordMismatch"          : "The provided passwords do not match.", | ||||
|                 "permissions"               : "Permissions:", | ||||
|                 "permissions"               : "Permissions", | ||||
|                 "username"                  : "Username:", | ||||
|                 "administerSystem"          : "Administer system:", | ||||
|                 "createUser"                : "Create new users:", | ||||
|                 "createConnection"          : "Create new connections:", | ||||
|                 "createConnectionGroup"     : "Create new connection groups:", | ||||
|                 "connections"               : "Connections:" | ||||
|                 "connections"               : "Connections" | ||||
|             } | ||||
|         }, | ||||
|         "error": { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user