mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUAC-1103: Explicitly cast permission types.
This commit is contained in:
		| @@ -61,7 +61,7 @@ | ||||
|         JOIN guacamole_user ON guacamole_connection_group_permission.user_id = guacamole_user.user_id | ||||
|         WHERE | ||||
|             guacamole_connection_group_permission.user_id = #{user.objectID,jdbcType=INTEGER} | ||||
|             AND permission = #{type,jdbcType=VARCHAR} | ||||
|             AND permission = #{type,jdbcType=VARCHAR}::guacamole_object_permission_type | ||||
|             AND connection_group_id = #{identifier,jdbcType=VARCHAR} | ||||
|  | ||||
|     </select> | ||||
| @@ -81,7 +81,7 @@ | ||||
|             AND permission IN | ||||
|                 <foreach collection="permissions" item="permission" | ||||
|                          open="(" separator="," close=")"> | ||||
|                     #{permission,jdbcType=VARCHAR} | ||||
|                     #{permission,jdbcType=VARCHAR}::guacamole_object_permission_type | ||||
|                 </foreach> | ||||
|  | ||||
|     </select> | ||||
| @@ -94,7 +94,7 @@ | ||||
|             <foreach collection="permissions" item="permission" | ||||
|                      open="(" separator="," close=")"> | ||||
|                 (#{permission.userID,jdbcType=INTEGER}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, | ||||
|                  #{permission.objectIdentifier,jdbcType=VARCHAR}) | ||||
|             </foreach> | ||||
|  | ||||
| @@ -111,7 +111,7 @@ | ||||
|         VALUES | ||||
|             <foreach collection="permissions" item="permission" separator=","> | ||||
|                 (#{permission.userID,jdbcType=INTEGER}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, | ||||
|                  #{permission.objectIdentifier,jdbcType=VARCHAR}) | ||||
|             </foreach> | ||||
|  | ||||
|   | ||||
| @@ -61,7 +61,7 @@ | ||||
|         JOIN guacamole_user ON guacamole_connection_permission.user_id = guacamole_user.user_id | ||||
|         WHERE | ||||
|             guacamole_connection_permission.user_id = #{user.objectID,jdbcType=INTEGER} | ||||
|             AND permission = #{type,jdbcType=VARCHAR} | ||||
|             AND permission = #{type,jdbcType=VARCHAR}::guacamole_object_permission_type | ||||
|             AND connection_id = #{identifier,jdbcType=VARCHAR} | ||||
|  | ||||
|     </select> | ||||
| @@ -81,7 +81,7 @@ | ||||
|             AND permission IN | ||||
|                 <foreach collection="permissions" item="permission" | ||||
|                          open="(" separator="," close=")"> | ||||
|                     #{permission,jdbcType=VARCHAR} | ||||
|                     #{permission,jdbcType=VARCHAR}::guacamole_object_permission_type | ||||
|                 </foreach> | ||||
|  | ||||
|     </select> | ||||
| @@ -94,7 +94,7 @@ | ||||
|             <foreach collection="permissions" item="permission" | ||||
|                      open="(" separator="," close=")"> | ||||
|                 (#{permission.userID,jdbcType=INTEGER}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, | ||||
|                  #{permission.objectIdentifier,jdbcType=VARCHAR}) | ||||
|             </foreach> | ||||
|  | ||||
| @@ -111,7 +111,7 @@ | ||||
|         VALUES | ||||
|             <foreach collection="permissions" item="permission" separator=","> | ||||
|                 (#{permission.userID,jdbcType=INTEGER}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, | ||||
|                  #{permission.objectIdentifier,jdbcType=VARCHAR}) | ||||
|             </foreach> | ||||
|  | ||||
|   | ||||
| @@ -58,7 +58,7 @@ | ||||
|         JOIN guacamole_user ON guacamole_system_permission.user_id = guacamole_user.user_id | ||||
|         WHERE | ||||
|             guacamole_system_permission.user_id = #{user.objectID,jdbcType=INTEGER} | ||||
|             AND permission = #{type,jdbcType=VARCHAR} | ||||
|             AND permission = #{type,jdbcType=VARCHAR}::guacamole_system_permission_type | ||||
|  | ||||
|     </select> | ||||
|  | ||||
| @@ -70,7 +70,7 @@ | ||||
|             <foreach collection="permissions" item="permission" | ||||
|                      open="(" separator="," close=")"> | ||||
|                 (#{permission.userID,jdbcType=INTEGER}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}) | ||||
|                  #{permission.type,jdbcType=VARCHAR}::guacamole_system_permission_type) | ||||
|             </foreach> | ||||
|  | ||||
|     </delete> | ||||
| @@ -85,7 +85,7 @@ | ||||
|         VALUES | ||||
|             <foreach collection="permissions" item="permission" separator=","> | ||||
|                 (#{permission.userID,jdbcType=INTEGER}, | ||||
|                  #{permission.type,jdbcType=VARCHAR}) | ||||
|                  #{permission.type,jdbcType=VARCHAR}::guacamole_system_permission_type) | ||||
|             </foreach> | ||||
|  | ||||
|     </insert> | ||||
|   | ||||
| @@ -63,7 +63,7 @@ | ||||
|         JOIN guacamole_user affected ON guacamole_user_permission.affected_user_id = affected.user_id | ||||
|         WHERE | ||||
|             guacamole_user_permission.user_id = #{user.objectID,jdbcType=INTEGER} | ||||
|             AND permission = #{type,jdbcType=VARCHAR} | ||||
|             AND permission = #{type,jdbcType=VARCHAR}::guacamole_object_permission_type | ||||
|             AND affected.username = #{identifier,jdbcType=VARCHAR} | ||||
|  | ||||
|     </select> | ||||
| @@ -84,7 +84,7 @@ | ||||
|             AND permission IN | ||||
|                 <foreach collection="permissions" item="permission" | ||||
|                          open="(" separator="," close=")"> | ||||
|                     #{permission,jdbcType=VARCHAR} | ||||
|                     #{permission,jdbcType=VARCHAR}::guacamole_object_permission_type | ||||
|                 </foreach> | ||||
|  | ||||
|     </select> | ||||
| @@ -100,7 +100,7 @@ | ||||
|                 <foreach collection="permissions" item="permission" | ||||
|                          open="(" separator="," close=")"> | ||||
|                     (#{permission.userID,jdbcType=INTEGER}, | ||||
|                      #{permission.type,jdbcType=VARCHAR}, | ||||
|                      #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, | ||||
|                      #{permission.objectIdentifier,jdbcType=VARCHAR}) | ||||
|                 </foreach> | ||||
|  | ||||
| @@ -117,9 +117,9 @@ | ||||
|         SELECT permissions.user_id, permissions.permission, guacamole_user.user_id FROM | ||||
|             <foreach collection="permissions" item="permission" | ||||
|                      open="(" separator="UNION ALL" close=")"> | ||||
|                 SELECT #{permission.userID,jdbcType=INTEGER}           AS user_id, | ||||
|                        #{permission.type,jdbcType=VARCHAR}             AS permission, | ||||
|                        #{permission.objectIdentifier,jdbcType=VARCHAR} AS username | ||||
|                 SELECT #{permission.userID,jdbcType=INTEGER}                                 AS user_id, | ||||
|                        #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type AS permission, | ||||
|                        #{permission.objectIdentifier,jdbcType=VARCHAR}                       AS username | ||||
|             </foreach> | ||||
|         AS permissions | ||||
|         JOIN guacamole_user ON guacamole_user.username = permissions.username;  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user