mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-363: Standardize table names with other JDBC modules; switch back to dbo schema for now.
This commit is contained in:
@@ -51,13 +51,13 @@
|
||||
<!-- Select all connection identifiers -->
|
||||
<select id="selectIdentifiers" resultType="string">
|
||||
SELECT connection_id
|
||||
FROM [guacamole].[connection]
|
||||
FROM [dbo].[guacamole_connection]
|
||||
</select>
|
||||
|
||||
<!-- Select identifiers of all readable connections -->
|
||||
<select id="selectReadableIdentifiers" resultType="string">
|
||||
SELECT connection_id
|
||||
FROM [guacamole].[connection_permission]
|
||||
FROM [dbo].[guacamole_connection_permission]
|
||||
WHERE
|
||||
user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
@@ -66,7 +66,7 @@
|
||||
<!-- Select all connection identifiers within a particular connection group -->
|
||||
<select id="selectIdentifiersWithin" resultType="string">
|
||||
SELECT connection_id
|
||||
FROM [guacamole].[connection]
|
||||
FROM [dbo].[guacamole_connection]
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
@@ -74,9 +74,9 @@
|
||||
|
||||
<!-- Select identifiers of all readable connections within a particular connection group -->
|
||||
<select id="selectReadableIdentifiersWithin" resultType="string">
|
||||
SELECT [guacamole].[connection].connection_id
|
||||
FROM [guacamole].[connection]
|
||||
JOIN [guacamole].[connection_permission] ON [guacamole].[connection_permission].connection_id = [guacamole].[connection].connection_id
|
||||
SELECT [dbo].[guacamole_connection].connection_id
|
||||
FROM [dbo].[guacamole_connection]
|
||||
JOIN [dbo].[guacamole_connection_permission] ON [dbo].[guacamole_connection_permission].connection_id = [dbo].[guacamole_connection].connection_id
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
@@ -100,7 +100,7 @@
|
||||
proxy_encryption_method,
|
||||
connection_weight,
|
||||
failover_only
|
||||
FROM [guacamole].[connection]
|
||||
FROM [dbo].[guacamole_connection]
|
||||
WHERE connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -108,7 +108,7 @@
|
||||
</foreach>;
|
||||
|
||||
SELECT primary_connection_id, sharing_profile_id
|
||||
FROM [guacamole].[sharing_profile]
|
||||
FROM [dbo].[guacamole_sharing_profile]
|
||||
WHERE primary_connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -122,7 +122,7 @@
|
||||
resultSets="connections,sharingProfiles">
|
||||
|
||||
SELECT
|
||||
[guacamole].[connection].connection_id,
|
||||
[dbo].[guacamole_connection].connection_id,
|
||||
connection_name,
|
||||
parent_id,
|
||||
protocol,
|
||||
@@ -133,9 +133,9 @@
|
||||
proxy_encryption_method,
|
||||
connection_weight,
|
||||
failover_only
|
||||
FROM [guacamole].[connection]
|
||||
JOIN [guacamole].[connection_permission] ON [guacamole].[connection_permission].connection_id = [guacamole].[connection].connection_id
|
||||
WHERE [guacamole].[connection].connection_id IN
|
||||
FROM [dbo].[guacamole_connection]
|
||||
JOIN [dbo].[guacamole_connection_permission] ON [dbo].[guacamole_connection_permission].connection_id = [dbo].[guacamole_connection].connection_id
|
||||
WHERE [dbo].[guacamole_connection].connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
@@ -143,9 +143,9 @@
|
||||
AND user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ';
|
||||
|
||||
SELECT primary_connection_id, [guacamole].[sharing_profile].sharing_profile_id
|
||||
FROM [guacamole].[sharing_profile]
|
||||
JOIN [guacamole].[sharing_profile_permission] ON [guacamole].[sharing_profile_permission].sharing_profile_id = [guacamole].[sharing_profile].sharing_profile_id
|
||||
SELECT primary_connection_id, [dbo].[guacamole_sharing_profile].sharing_profile_id
|
||||
FROM [dbo].[guacamole_sharing_profile]
|
||||
JOIN [dbo].[guacamole_sharing_profile_permission] ON [dbo].[guacamole_sharing_profile_permission].sharing_profile_id = [dbo].[guacamole_sharing_profile].sharing_profile_id
|
||||
WHERE primary_connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -171,7 +171,7 @@
|
||||
proxy_encryption_method,
|
||||
connection_weight,
|
||||
failover_only
|
||||
FROM [guacamole].[connection]
|
||||
FROM [dbo].[guacamole_connection]
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
<!-- Delete single connection by identifier -->
|
||||
<delete id="delete">
|
||||
DELETE FROM [guacamole].[connection]
|
||||
DELETE FROM [dbo].[guacamole_connection]
|
||||
WHERE connection_id = #{identifier,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
|
||||
parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionModel">
|
||||
|
||||
INSERT INTO [guacamole].[connection] (
|
||||
INSERT INTO [dbo].[guacamole_connection] (
|
||||
connection_name,
|
||||
parent_id,
|
||||
protocol,
|
||||
@@ -218,7 +218,7 @@
|
||||
|
||||
<!-- Update single connection -->
|
||||
<update id="update" parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionModel">
|
||||
UPDATE [guacamole].[connection]
|
||||
UPDATE [dbo].[guacamole_connection]
|
||||
SET connection_name = #{object.name,jdbcType=VARCHAR},
|
||||
parent_id = #{object.parentIdentifier,jdbcType=INTEGER},
|
||||
protocol = #{object.protocol,jdbcType=VARCHAR},
|
||||
|
@@ -36,21 +36,21 @@
|
||||
connection_id,
|
||||
parameter_name,
|
||||
parameter_value
|
||||
FROM [guacamole].[connection_parameter]
|
||||
FROM [dbo].[guacamole_connection_parameter]
|
||||
WHERE
|
||||
connection_id = #{identifier,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<!-- Delete all parameters of a given connection -->
|
||||
<delete id="delete">
|
||||
DELETE FROM [guacamole].[connection_parameter]
|
||||
DELETE FROM [dbo].[guacamole_connection_parameter]
|
||||
WHERE connection_id = #{identifier,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
<!-- Insert all given parameters -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionParameterModel">
|
||||
|
||||
INSERT INTO [guacamole].[connection_parameter] (
|
||||
INSERT INTO [dbo].[guacamole_connection_parameter] (
|
||||
connection_id,
|
||||
parameter_name,
|
||||
parameter_value
|
||||
|
@@ -40,28 +40,28 @@
|
||||
<select id="select" resultMap="ConnectionRecordResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[connection_history].connection_id,
|
||||
[guacamole].[connection_history].connection_name,
|
||||
[guacamole].[connection_history].remote_host,
|
||||
[guacamole].[connection_history].sharing_profile_id,
|
||||
[guacamole].[connection_history].sharing_profile_name,
|
||||
[guacamole].[connection_history].user_id,
|
||||
[guacamole].[connection_history].username,
|
||||
[guacamole].[connection_history].start_date,
|
||||
[guacamole].[connection_history].end_date
|
||||
FROM [guacamole].[connection_history]
|
||||
[dbo].[guacamole_connection_history].connection_id,
|
||||
[dbo].[guacamole_connection_history].connection_name,
|
||||
[dbo].[guacamole_connection_history].remote_host,
|
||||
[dbo].[guacamole_connection_history].sharing_profile_id,
|
||||
[dbo].[guacamole_connection_history].sharing_profile_name,
|
||||
[dbo].[guacamole_connection_history].user_id,
|
||||
[dbo].[guacamole_connection_history].username,
|
||||
[dbo].[guacamole_connection_history].start_date,
|
||||
[dbo].[guacamole_connection_history].end_date
|
||||
FROM [dbo].[guacamole_connection_history]
|
||||
WHERE
|
||||
[guacamole].[connection_history].connection_id = #{identifier,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_connection_history].connection_id = #{identifier,jdbcType=INTEGER}
|
||||
ORDER BY
|
||||
[guacamole].[connection_history].start_date DESC,
|
||||
[guacamole].[connection_history].end_date DESC
|
||||
[dbo].[guacamole_connection_history].start_date DESC,
|
||||
[dbo].[guacamole_connection_history].end_date DESC
|
||||
|
||||
</select>
|
||||
|
||||
<!-- Insert the given connection record -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionRecordModel">
|
||||
|
||||
INSERT INTO [guacamole].[connection_history] (
|
||||
INSERT INTO [dbo].[guacamole_connection_history] (
|
||||
connection_id,
|
||||
connection_name,
|
||||
remote_host,
|
||||
@@ -78,7 +78,7 @@
|
||||
#{record.remoteHost,jdbcType=VARCHAR},
|
||||
#{record.sharingProfileIdentifier,jdbcType=INTEGER},
|
||||
#{record.sharingProfileName,jdbcType=VARCHAR},
|
||||
(SELECT user_id FROM [guacamole].[user]
|
||||
(SELECT user_id FROM [dbo].[guacamole_user]
|
||||
WHERE username = #{record.username,jdbcType=VARCHAR}),
|
||||
#{record.username,jdbcType=VARCHAR},
|
||||
#{record.startDate,jdbcType=TIMESTAMP},
|
||||
@@ -91,31 +91,31 @@
|
||||
<select id="search" resultMap="ConnectionRecordResultMap">
|
||||
|
||||
SELECT TOP (#{limit,jdbcType=INTEGER})
|
||||
[guacamole].[connection_history].connection_id,
|
||||
[guacamole].[connection_history].connection_name,
|
||||
[guacamole].[connection_history].remote_host,
|
||||
[guacamole].[connection_history].sharing_profile_id,
|
||||
[guacamole].[connection_history].sharing_profile_name,
|
||||
[guacamole].[connection_history].user_id,
|
||||
[guacamole].[connection_history].username,
|
||||
[guacamole].[connection_history].start_date,
|
||||
[guacamole].[connection_history].end_date
|
||||
FROM [guacamole].[connection_history]
|
||||
[dbo].[guacamole_connection_history].connection_id,
|
||||
[dbo].[guacamole_connection_history].connection_name,
|
||||
[dbo].[guacamole_connection_history].remote_host,
|
||||
[dbo].[guacamole_connection_history].sharing_profile_id,
|
||||
[dbo].[guacamole_connection_history].sharing_profile_name,
|
||||
[dbo].[guacamole_connection_history].user_id,
|
||||
[dbo].[guacamole_connection_history].username,
|
||||
[dbo].[guacamole_connection_history].start_date,
|
||||
[dbo].[guacamole_connection_history].end_date
|
||||
FROM [dbo].[guacamole_connection_history]
|
||||
|
||||
<!-- Search terms -->
|
||||
<foreach collection="terms" item="term"
|
||||
open="WHERE " separator=" AND ">
|
||||
(
|
||||
|
||||
[guacamole].[connection_history].user_id IN (
|
||||
[dbo].[guacamole_connection_history].user_id IN (
|
||||
SELECT user_id
|
||||
FROM [guacamole].[user]
|
||||
FROM [dbo].[guacamole_user]
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||
)
|
||||
|
||||
OR [guacamole].[connection_history].connection_id IN (
|
||||
OR [dbo].[guacamole_connection_history].connection_id IN (
|
||||
SELECT connection_id
|
||||
FROM [guacamole].[connection]
|
||||
FROM [dbo].[guacamole_connection]
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||
)
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<foreach collection="sortPredicates" item="sortPredicate"
|
||||
open="ORDER BY " separator=", ">
|
||||
<choose>
|
||||
<when test="sortPredicate.property == START_DATE">[guacamole].[connection_history].start_date</when>
|
||||
<when test="sortPredicate.property == START_DATE">[dbo].[guacamole_connection_history].start_date</when>
|
||||
<otherwise>1</otherwise>
|
||||
</choose>
|
||||
<if test="sortPredicate.descending">DESC</if>
|
||||
@@ -145,45 +145,45 @@
|
||||
<select id="searchReadable" resultMap="ConnectionRecordResultMap">
|
||||
|
||||
SELECT TOP (#{limit,jdbcType=INTEGER})
|
||||
[guacamole].[connection_history].connection_id,
|
||||
[guacamole].[connection_history].connection_name,
|
||||
[guacamole].[connection_history].remote_host,
|
||||
[guacamole].[connection_history].sharing_profile_id,
|
||||
[guacamole].[connection_history].sharing_profile_name,
|
||||
[guacamole].[connection_history].user_id,
|
||||
[guacamole].[connection_history].username,
|
||||
[guacamole].[connection_history].start_date,
|
||||
[guacamole].[connection_history].end_date
|
||||
FROM [guacamole].[connection_history]
|
||||
LEFT JOIN [guacamole].[connection] ON [guacamole].[connection_history].connection_id = [guacamole].[connection].connection_id
|
||||
LEFT JOIN [guacamole].[user] ON [guacamole].[connection_history].user_id = [guacamole].[user].user_id
|
||||
[dbo].[guacamole_connection_history].connection_id,
|
||||
[dbo].[guacamole_connection_history].connection_name,
|
||||
[dbo].[guacamole_connection_history].remote_host,
|
||||
[dbo].[guacamole_connection_history].sharing_profile_id,
|
||||
[dbo].[guacamole_connection_history].sharing_profile_name,
|
||||
[dbo].[guacamole_connection_history].user_id,
|
||||
[dbo].[guacamole_connection_history].username,
|
||||
[dbo].[guacamole_connection_history].start_date,
|
||||
[dbo].[guacamole_connection_history].end_date
|
||||
FROM [dbo].[guacamole_connection_history]
|
||||
LEFT JOIN [dbo].[guacamole_connection] ON [dbo].[guacamole_connection_history].connection_id = [dbo].[guacamole_connection].connection_id
|
||||
LEFT JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_connection_history].user_id = [dbo].[guacamole_user].user_id
|
||||
|
||||
<!-- Restrict to readable connections -->
|
||||
JOIN [guacamole].[connection_permission] ON
|
||||
[guacamole].[connection_history].connection_id = [guacamole].[connection_permission].connection_id
|
||||
AND [guacamole].[connection_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND [guacamole].[connection_permission].permission = 'READ'
|
||||
JOIN [dbo].[guacamole_connection_permission] ON
|
||||
[dbo].[guacamole_connection_history].connection_id = [dbo].[guacamole_connection_permission].connection_id
|
||||
AND [dbo].[guacamole_connection_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND [dbo].[guacamole_connection_permission].permission = 'READ'
|
||||
|
||||
<!-- Restrict to readable users -->
|
||||
JOIN [guacamole].[user_permission] ON
|
||||
[guacamole].[connection_history].user_id = [guacamole].[user_permission].affected_user_id
|
||||
AND [guacamole].[user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND [guacamole].[user_permission].permission = 'READ'
|
||||
JOIN [dbo].[guacamole_user_permission] ON
|
||||
[dbo].[guacamole_connection_history].user_id = [dbo].[guacamole_user_permission].affected_user_id
|
||||
AND [dbo].[guacamole_user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND [dbo].[guacamole_user_permission].permission = 'READ'
|
||||
|
||||
<!-- Search terms -->
|
||||
<foreach collection="terms" item="term"
|
||||
open="WHERE " separator=" AND ">
|
||||
(
|
||||
|
||||
[guacamole].[connection_history].user_id IN (
|
||||
[dbo].[guacamole_connection_history].user_id IN (
|
||||
SELECT user_id
|
||||
FROM [guacamole].[user]
|
||||
FROM [dbo].[guacamole_user]
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||
)
|
||||
|
||||
OR [guacamole].[connection_history].connection_id IN (
|
||||
OR [dbo].[guacamole_connection_history].connection_id IN (
|
||||
SELECT connection_id
|
||||
FROM [guacamole].[connection]
|
||||
FROM [dbo].[guacamole_connection]
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||
)
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
<foreach collection="sortPredicates" item="sortPredicate"
|
||||
open="ORDER BY " separator=", ">
|
||||
<choose>
|
||||
<when test="sortPredicate.property == START_DATE">[guacamole].[connection_history].start_date</when>
|
||||
<when test="sortPredicate.property == START_DATE">[dbo].[guacamole_connection_history].start_date</when>
|
||||
<otherwise>1</otherwise>
|
||||
</choose>
|
||||
<if test="sortPredicate.descending">DESC</if>
|
||||
|
@@ -53,13 +53,13 @@
|
||||
<!-- Select all connection group identifiers -->
|
||||
<select id="selectIdentifiers" resultType="string">
|
||||
SELECT connection_group_id
|
||||
FROM [guacamole].[connection_group]
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
</select>
|
||||
|
||||
<!-- Select identifiers of all readable connection groups -->
|
||||
<select id="selectReadableIdentifiers" resultType="string">
|
||||
SELECT connection_group_id
|
||||
FROM [guacamole].[connection_group_permission]
|
||||
FROM [dbo].[guacamole_connection_group_permission]
|
||||
WHERE
|
||||
user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
@@ -68,7 +68,7 @@
|
||||
<!-- Select all connection identifiers within a particular connection group -->
|
||||
<select id="selectIdentifiersWithin" resultType="string">
|
||||
SELECT connection_group_id
|
||||
FROM [guacamole].[connection_group]
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
@@ -76,9 +76,9 @@
|
||||
|
||||
<!-- Select identifiers of all readable connection groups within a particular connection group -->
|
||||
<select id="selectReadableIdentifiersWithin" resultType="string">
|
||||
SELECT [guacamole].[connection_group].connection_group_id
|
||||
FROM [guacamole].[connection_group]
|
||||
JOIN [guacamole].[connection_group_permission] ON [guacamole].[connection_group_permission].connection_group_id = [guacamole].[connection_group].connection_group_id
|
||||
SELECT [dbo].[guacamole_connection_group].connection_group_id
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
JOIN [dbo].[guacamole_connection_group_permission] ON [dbo].[guacamole_connection_group_permission].connection_group_id = [dbo].[guacamole_connection_group].connection_group_id
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
@@ -98,7 +98,7 @@
|
||||
max_connections,
|
||||
max_connections_per_user,
|
||||
enable_session_affinity
|
||||
FROM [guacamole].[connection_group]
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
WHERE connection_group_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -106,7 +106,7 @@
|
||||
</foreach>;
|
||||
|
||||
SELECT parent_id, connection_group_id
|
||||
FROM [guacamole].[connection_group]
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
WHERE parent_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -114,7 +114,7 @@
|
||||
</foreach>;
|
||||
|
||||
SELECT parent_id, connection_id
|
||||
FROM [guacamole].[connection]
|
||||
FROM [dbo].[guacamole_connection]
|
||||
WHERE parent_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -128,16 +128,16 @@
|
||||
resultSets="connectionGroups,childConnectionGroups,childConnections">
|
||||
|
||||
SELECT
|
||||
[guacamole].[connection_group].connection_group_id,
|
||||
[dbo].[guacamole_connection_group].connection_group_id,
|
||||
connection_group_name,
|
||||
parent_id,
|
||||
type,
|
||||
max_connections,
|
||||
max_connections_per_user,
|
||||
enable_session_affinity
|
||||
FROM [guacamole].[connection_group]
|
||||
JOIN [guacamole].[connection_group_permission] ON [guacamole].[connection_group_permission].connection_group_id = [guacamole].[connection_group].connection_group_id
|
||||
WHERE [guacamole].[connection_group].connection_group_id IN
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
JOIN [dbo].[guacamole_connection_group_permission] ON [dbo].[guacamole_connection_group_permission].connection_group_id = [dbo].[guacamole_connection_group].connection_group_id
|
||||
WHERE [dbo].[guacamole_connection_group].connection_group_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
@@ -145,9 +145,9 @@
|
||||
AND user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ';
|
||||
|
||||
SELECT parent_id, [guacamole].[connection_group].connection_group_id
|
||||
FROM [guacamole].[connection_group]
|
||||
JOIN [guacamole].[connection_group_permission] ON [guacamole].[connection_group_permission].connection_group_id = [guacamole].[connection_group].connection_group_id
|
||||
SELECT parent_id, [dbo].[guacamole_connection_group].connection_group_id
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
JOIN [dbo].[guacamole_connection_group_permission] ON [dbo].[guacamole_connection_group_permission].connection_group_id = [dbo].[guacamole_connection_group].connection_group_id
|
||||
WHERE parent_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -156,9 +156,9 @@
|
||||
AND user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ';
|
||||
|
||||
SELECT parent_id, [guacamole].[connection].connection_id
|
||||
FROM [guacamole].[connection]
|
||||
JOIN [guacamole].[connection_permission] ON [guacamole].[connection_permission].connection_id = [guacamole].[connection].connection_id
|
||||
SELECT parent_id, [dbo].[guacamole_connection].connection_id
|
||||
FROM [dbo].[guacamole_connection]
|
||||
JOIN [dbo].[guacamole_connection_permission] ON [dbo].[guacamole_connection_permission].connection_id = [dbo].[guacamole_connection].connection_id
|
||||
WHERE parent_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -180,7 +180,7 @@
|
||||
max_connections,
|
||||
max_connections_per_user,
|
||||
enable_session_affinity
|
||||
FROM [guacamole].[connection_group]
|
||||
FROM [dbo].[guacamole_connection_group]
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
<!-- Delete single connection group by identifier -->
|
||||
<delete id="delete">
|
||||
DELETE FROM [guacamole].[connection_group]
|
||||
DELETE FROM [dbo].[guacamole_connection_group]
|
||||
WHERE connection_group_id = #{identifier,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
|
||||
parameterType="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupModel">
|
||||
|
||||
INSERT INTO [guacamole].[connection_group] (
|
||||
INSERT INTO [dbo].[guacamole_connection_group] (
|
||||
connection_group_name,
|
||||
parent_id,
|
||||
type,
|
||||
@@ -219,7 +219,7 @@
|
||||
|
||||
<!-- Update single connection group -->
|
||||
<update id="update" parameterType="org.apache.guacamole.auth.jdbc.connectiongroup.ConnectionGroupModel">
|
||||
UPDATE [guacamole].[connection_group]
|
||||
UPDATE [dbo].[guacamole_connection_group]
|
||||
SET connection_group_name = #{object.name,jdbcType=VARCHAR},
|
||||
parent_id = #{object.parentIdentifier,jdbcType=INTEGER},
|
||||
type = #{object.type,jdbcType=VARCHAR},
|
||||
|
@@ -36,13 +36,13 @@
|
||||
<select id="select" resultMap="ConnectionGroupPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[connection_group_permission].user_id,
|
||||
[dbo].[guacamole_connection_group_permission].user_id,
|
||||
username,
|
||||
permission,
|
||||
connection_group_id
|
||||
FROM [guacamole].[connection_group_permission]
|
||||
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}
|
||||
FROM [dbo].[guacamole_connection_group_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_connection_group_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE [dbo].[guacamole_connection_group_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
|
||||
</select>
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
<select id="selectOne" resultMap="ConnectionGroupPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[connection_group_permission].user_id,
|
||||
[dbo].[guacamole_connection_group_permission].user_id,
|
||||
username,
|
||||
permission,
|
||||
connection_group_id
|
||||
FROM [guacamole].[connection_group_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[connection_group_permission].user_id = [guacamole].[user].user_id
|
||||
FROM [dbo].[guacamole_connection_group_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_connection_group_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE
|
||||
[guacamole].[connection_group_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_connection_group_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND connection_group_id = #{identifier,jdbcType=INTEGER}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<select id="selectAccessibleIdentifiers" resultType="string">
|
||||
|
||||
SELECT DISTINCT connection_group_id
|
||||
FROM [guacamole].[connection_group_permission]
|
||||
FROM [dbo].[guacamole_connection_group_permission]
|
||||
WHERE
|
||||
user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND connection_group_id IN
|
||||
@@ -86,7 +86,7 @@
|
||||
<!-- Delete all given permissions -->
|
||||
<delete id="delete" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
DELETE FROM [guacamole].[connection_group_permission]
|
||||
DELETE FROM [dbo].[guacamole_connection_group_permission]
|
||||
WHERE (user_id, permission, connection_group_id) IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
@@ -100,7 +100,7 @@
|
||||
<!-- Insert all given permissions -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
INSERT INTO [guacamole].[connection_group_permission] (
|
||||
INSERT INTO [dbo].[guacamole_connection_group_permission] (
|
||||
user_id,
|
||||
permission,
|
||||
connection_group_id
|
||||
@@ -117,10 +117,10 @@
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER} AS connection_group_id
|
||||
</foreach>
|
||||
AS permissions
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [guacamole].[connection_group_permission]
|
||||
WHERE [guacamole].[connection_group_permission].user_id = permissions.user_id AND
|
||||
[guacamole].[connection_group_permission].permission = permissions.permission AND
|
||||
[guacamole].[connection_group_permission].connection_group_id = permissions.connection_group_id
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [dbo].[guacamole_connection_group_permission]
|
||||
WHERE [dbo].[guacamole_connection_group_permission].user_id = permissions.user_id AND
|
||||
[dbo].[guacamole_connection_group_permission].permission = permissions.permission AND
|
||||
[dbo].[guacamole_connection_group_permission].connection_group_id = permissions.connection_group_id
|
||||
);
|
||||
|
||||
</insert>
|
||||
|
@@ -36,13 +36,13 @@
|
||||
<select id="select" resultMap="ConnectionPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[connection_permission].user_id,
|
||||
[dbo].[guacamole_connection_permission].user_id,
|
||||
username,
|
||||
permission,
|
||||
connection_id
|
||||
FROM [guacamole].[connection_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[connection_permission].user_id = [guacamole].[user].user_id
|
||||
WHERE [guacamole].[connection_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
FROM [dbo].[guacamole_connection_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_connection_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE [dbo].[guacamole_connection_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
|
||||
</select>
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
<select id="selectOne" resultMap="ConnectionPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[connection_permission].user_id,
|
||||
[dbo].[guacamole_connection_permission].user_id,
|
||||
username,
|
||||
permission,
|
||||
connection_id
|
||||
FROM [guacamole].[connection_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[connection_permission].user_id = [guacamole].[user].user_id
|
||||
FROM [dbo].[guacamole_connection_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_connection_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE
|
||||
[guacamole].[connection_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_connection_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND connection_id = #{identifier,jdbcType=INTEGER}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<select id="selectAccessibleIdentifiers" resultType="string">
|
||||
|
||||
SELECT DISTINCT connection_id
|
||||
FROM [guacamole].[connection_permission]
|
||||
FROM [dbo].[guacamole_connection_permission]
|
||||
WHERE
|
||||
user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND connection_id IN
|
||||
@@ -86,7 +86,7 @@
|
||||
<!-- Delete all given permissions -->
|
||||
<delete id="delete" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
DELETE FROM [guacamole].[connection_permission]
|
||||
DELETE FROM [dbo].[guacamole_connection_permission]
|
||||
WHERE
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator=" OR " close=")">
|
||||
@@ -100,7 +100,7 @@
|
||||
<!-- Insert all given permissions -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
INSERT INTO [guacamole].[connection_permission] (
|
||||
INSERT INTO [dbo].[guacamole_connection_permission] (
|
||||
user_id,
|
||||
permission,
|
||||
connection_id
|
||||
@@ -117,10 +117,10 @@
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER} AS connection_id
|
||||
</foreach>
|
||||
AS permissions
|
||||
WHERE NOT EXISTS ( SELECT 1 FROM [guacamole].[connection_permission]
|
||||
WHERE [guacamole].[connection_permission].user_id = permissions.user_id AND
|
||||
[guacamole].[connection_permission].permission = permissions.permission AND
|
||||
[guacamole].[connection_permission].connection_id = permissions.connection_id
|
||||
WHERE NOT EXISTS ( SELECT 1 FROM [dbo].[guacamole_connection_permission]
|
||||
WHERE [dbo].[guacamole_connection_permission].user_id = permissions.user_id AND
|
||||
[dbo].[guacamole_connection_permission].permission = permissions.permission AND
|
||||
[dbo].[guacamole_connection_permission].connection_id = permissions.connection_id
|
||||
);
|
||||
|
||||
</insert>
|
||||
|
@@ -36,13 +36,13 @@
|
||||
<select id="select" resultMap="SharingProfilePermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[sharing_profile_permission].user_id,
|
||||
[dbo].[guacamole_sharing_profile_permission].user_id,
|
||||
username,
|
||||
permission,
|
||||
sharing_profile_id
|
||||
FROM [guacamole].[sharing_profile_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[sharing_profile_permission].user_id = [guacamole].[user].user_id
|
||||
WHERE [guacamole].[sharing_profile_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
FROM [dbo].[guacamole_sharing_profile_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_sharing_profile_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE [dbo].[guacamole_sharing_profile_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
|
||||
</select>
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
<select id="selectOne" resultMap="SharingProfilePermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[sharing_profile_permission].user_id,
|
||||
[dbo].[guacamole_sharing_profile_permission].user_id,
|
||||
username,
|
||||
permission,
|
||||
sharing_profile_id
|
||||
FROM [guacamole].[sharing_profile_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[sharing_profile_permission].user_id = [guacamole].[user].user_id
|
||||
FROM [dbo].[guacamole_sharing_profile_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_sharing_profile_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE
|
||||
[guacamole].[sharing_profile_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_sharing_profile_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND sharing_profile_id = #{identifier,jdbcType=INTEGER}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<select id="selectAccessibleIdentifiers" resultType="string">
|
||||
|
||||
SELECT DISTINCT sharing_profile_id
|
||||
FROM [guacamole].[sharing_profile_permission]
|
||||
FROM [dbo].[guacamole_sharing_profile_permission]
|
||||
WHERE
|
||||
user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND sharing_profile_id IN
|
||||
@@ -86,7 +86,7 @@
|
||||
<!-- Delete all given permissions -->
|
||||
<delete id="delete" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
DELETE FROM [guacamole].[sharing_profile_permission]
|
||||
DELETE FROM [dbo].[guacamole_sharing_profile_permission]
|
||||
WHERE
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator=" OR " close=")">
|
||||
@@ -100,7 +100,7 @@
|
||||
<!-- Insert all given permissions -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
INSERT INTO [guacamole].[sharing_profile_permission] (
|
||||
INSERT INTO [dbo].[guacamole_sharing_profile_permission] (
|
||||
user_id,
|
||||
permission,
|
||||
sharing_profile_id
|
||||
@@ -117,10 +117,10 @@
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER} AS sharing_profile_id
|
||||
</foreach>
|
||||
AS permissions
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [guacamole].[sharing_profile_permission]
|
||||
WHERE [guacamole].[sharing_profile_permission].user_id = permissions.user_id
|
||||
AND [guacamole].[sharing_profile_permission].permission = permissions.permission
|
||||
AND [guacamole].[sharing_profile_permission].sharing_profile_id = permissions.sharing_profile_id
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [dbo].[guacamole_sharing_profile_permission]
|
||||
WHERE [dbo].[guacamole_sharing_profile_permission].user_id = permissions.user_id
|
||||
AND [dbo].[guacamole_sharing_profile_permission].permission = permissions.permission
|
||||
AND [dbo].[guacamole_sharing_profile_permission].sharing_profile_id = permissions.sharing_profile_id
|
||||
);
|
||||
|
||||
</insert>
|
||||
|
@@ -35,12 +35,12 @@
|
||||
<select id="select" resultMap="SystemPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[system_permission].user_id,
|
||||
[dbo].[guacamole_system_permission].user_id,
|
||||
username,
|
||||
permission
|
||||
FROM [guacamole].[system_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[system_permission].user_id = [guacamole].[user].user_id
|
||||
WHERE [guacamole].[system_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
FROM [dbo].[guacamole_system_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_system_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE [dbo].[guacamole_system_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
|
||||
</select>
|
||||
|
||||
@@ -48,13 +48,13 @@
|
||||
<select id="selectOne" resultMap="SystemPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[system_permission].user_id,
|
||||
[dbo].[guacamole_system_permission].user_id,
|
||||
username,
|
||||
permission
|
||||
FROM [guacamole].[system_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[system_permission].user_id = [guacamole].[user].user_id
|
||||
FROM [dbo].[guacamole_system_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_system_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE
|
||||
[guacamole].[system_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_system_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
|
||||
</select>
|
||||
@@ -62,7 +62,7 @@
|
||||
<!-- Delete all given permissions -->
|
||||
<delete id="delete" parameterType="org.apache.guacamole.auth.jdbc.permission.SystemPermissionModel">
|
||||
|
||||
DELETE FROM [guacamole].[system_permission]
|
||||
DELETE FROM [dbo].[guacamole_system_permission]
|
||||
WHERE
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator=" OR " close=")">
|
||||
@@ -75,7 +75,7 @@
|
||||
<!-- Insert all given permissions -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.permission.SystemPermissionModel">
|
||||
|
||||
INSERT INTO [guacamole].[system_permission] (
|
||||
INSERT INTO [dbo].[guacamole_system_permission] (
|
||||
user_id,
|
||||
permission
|
||||
)
|
||||
@@ -89,9 +89,9 @@
|
||||
#{permission.type,jdbcType=VARCHAR} AS permission
|
||||
</foreach>
|
||||
AS permissions
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [guacamole].[system_permission]
|
||||
WHERE [guacamole].[system_permission].user_id = permissions.user_id
|
||||
AND [guacamole].[system_permission].permission = permissions.permission
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [dbo].[guacamole_system_permission]
|
||||
WHERE [dbo].[guacamole_system_permission].user_id = permissions.user_id
|
||||
AND [dbo].[guacamole_system_permission].permission = permissions.permission
|
||||
);
|
||||
|
||||
</insert>
|
||||
|
@@ -36,14 +36,14 @@
|
||||
<select id="select" resultMap="UserPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[user_permission].user_id,
|
||||
[guacamole].[user].username,
|
||||
[dbo].[guacamole_user_permission].user_id,
|
||||
[dbo].[guacamole_user].username,
|
||||
permission,
|
||||
affected.username AS affected_username
|
||||
FROM [guacamole].[user_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[user_permission].user_id = [guacamole].[user].user_id
|
||||
JOIN [guacamole].[user] affected ON [guacamole].[user_permission].affected_user_id = affected.user_id
|
||||
WHERE [guacamole].[user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
FROM [dbo].[guacamole_user_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_user_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
JOIN [dbo].[guacamole_user] affected ON [dbo].[guacamole_user_permission].affected_user_id = affected.user_id
|
||||
WHERE [dbo].[guacamole_user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
|
||||
</select>
|
||||
|
||||
@@ -51,15 +51,15 @@
|
||||
<select id="selectOne" resultMap="UserPermissionResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[user_permission].user_id,
|
||||
[guacamole].[user].username,
|
||||
[dbo].[guacamole_user_permission].user_id,
|
||||
[dbo].[guacamole_user].username,
|
||||
permission,
|
||||
affected.username AS affected_username
|
||||
FROM [guacamole].[user_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[user_permission].user_id = [guacamole].[user].user_id
|
||||
JOIN [guacamole].[user] affected ON [guacamole].[user_permission].affected_user_id = affected.user_id
|
||||
FROM [dbo].[guacamole_user_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_user_permission].user_id = [dbo].[guacamole_user].user_id
|
||||
JOIN [dbo].[guacamole_user] affected ON [dbo].[guacamole_user_permission].affected_user_id = affected.user_id
|
||||
WHERE
|
||||
[guacamole].[user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = #{type,jdbcType=VARCHAR}
|
||||
AND affected.username = #{identifier,jdbcType=INTEGER}
|
||||
|
||||
@@ -69,10 +69,10 @@
|
||||
<select id="selectAccessibleIdentifiers" resultType="string">
|
||||
|
||||
SELECT DISTINCT username
|
||||
FROM [guacamole].[user_permission]
|
||||
JOIN [guacamole].[user] ON [guacamole].[user_permission].affected_user_id = [guacamole].[user].user_id
|
||||
FROM [dbo].[guacamole_user_permission]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_user_permission].affected_user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE
|
||||
[guacamole].[user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND username IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -89,11 +89,11 @@
|
||||
<!-- Delete all given permissions -->
|
||||
<delete id="delete" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
DELETE FROM [guacamole].[user_permission]
|
||||
USING [guacamole].[user] affected
|
||||
DELETE FROM [dbo].[guacamole_user_permission]
|
||||
USING [dbo].[guacamole_user] affected
|
||||
WHERE
|
||||
[guacamole].[user_permission].affected_user_id = affected.user_id
|
||||
AND ([guacamole].[user_permission].user_id, permission, affected.username) IN
|
||||
[dbo].[guacamole_user_permission].affected_user_id = affected.user_id
|
||||
AND ([dbo].[guacamole_user_permission].user_id, permission, affected.username) IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="," close=")">
|
||||
(#{permission.userID,jdbcType=INTEGER},
|
||||
@@ -106,7 +106,7 @@
|
||||
<!-- Insert all given permissions -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.permission.ObjectPermissionModel">
|
||||
|
||||
INSERT INTO [guacamole].[user_permission] (
|
||||
INSERT INTO [dbo].[guacamole_user_permission] (
|
||||
user_id,
|
||||
permission,
|
||||
affected_user_id
|
||||
@@ -114,7 +114,7 @@
|
||||
SELECT DISTINCT
|
||||
permissions.user_id,
|
||||
permissions.permission,
|
||||
[guacamole].[user].user_id
|
||||
[dbo].[guacamole_user].user_id
|
||||
FROM
|
||||
<foreach collection="permissions" item="permission"
|
||||
open="(" separator="UNION ALL" close=")">
|
||||
@@ -123,11 +123,11 @@
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER} AS username
|
||||
</foreach>
|
||||
AS permissions
|
||||
JOIN [guacamole].[user] ON [guacamole].[user].username = permissions.username
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [guacamole].[user_permission]
|
||||
WHERE [guacamole].[user_permission].user_id = permissions.user_id
|
||||
AND [guacamole].[user_permission].permission = permissions.permission
|
||||
AND [guacamole].[user_permission].affected_user_id = [guacamole].[user].user_id
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_user].username = permissions.username
|
||||
WHERE NOT EXISTS (SELECT 1 FROM [dbo].[guacamole_user_permission]
|
||||
WHERE [dbo].[guacamole_user_permission].user_id = permissions.user_id
|
||||
AND [dbo].[guacamole_user_permission].permission = permissions.permission
|
||||
AND [dbo].[guacamole_user_permission].affected_user_id = [dbo].[guacamole_user].user_id
|
||||
);
|
||||
|
||||
</insert>
|
||||
|
@@ -33,13 +33,13 @@
|
||||
<!-- Select all sharing profile identifiers -->
|
||||
<select id="selectIdentifiers" resultType="string">
|
||||
SELECT sharing_profile_id
|
||||
FROM [guacamole].[sharing_profile]
|
||||
FROM [dbo].[guacamole_sharing_profile]
|
||||
</select>
|
||||
|
||||
<!-- Select identifiers of all readable sharing profiles -->
|
||||
<select id="selectReadableIdentifiers" resultType="string">
|
||||
SELECT sharing_profile_id
|
||||
FROM [guacamole].[sharing_profile_permission]
|
||||
FROM [dbo].[guacamole_sharing_profile_permission]
|
||||
WHERE
|
||||
user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
@@ -52,7 +52,7 @@
|
||||
sharing_profile_id,
|
||||
sharing_profile_name,
|
||||
primary_connection_id
|
||||
FROM [guacamole].[sharing_profile]
|
||||
FROM [dbo].[guacamole_sharing_profile]
|
||||
WHERE sharing_profile_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -65,12 +65,12 @@
|
||||
<select id="selectReadable" resultMap="SharingProfileResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[sharing_profile].sharing_profile_id,
|
||||
[guacamole].[sharing_profile].sharing_profile_name,
|
||||
[dbo].[guacamole_sharing_profile].sharing_profile_id,
|
||||
[dbo].[guacamole_sharing_profile].sharing_profile_name,
|
||||
primary_connection_id
|
||||
FROM [guacamole].[sharing_profile]
|
||||
JOIN [guacamole].[sharing_profile_permission] ON [guacamole].[sharing_profile_permission].sharing_profile_id = [guacamole].[sharing_profile].sharing_profile_id
|
||||
WHERE [guacamole].[sharing_profile].sharing_profile_id IN
|
||||
FROM [dbo].[guacamole_sharing_profile]
|
||||
JOIN [dbo].[guacamole_sharing_profile_permission] ON [dbo].[guacamole_sharing_profile_permission].sharing_profile_id = [dbo].[guacamole_sharing_profile].sharing_profile_id
|
||||
WHERE [dbo].[guacamole_sharing_profile].sharing_profile_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
@@ -87,7 +87,7 @@
|
||||
sharing_profile_id,
|
||||
sharing_profile_name,
|
||||
primary_connection_id
|
||||
FROM [guacamole].[sharing_profile]
|
||||
FROM [dbo].[guacamole_sharing_profile]
|
||||
WHERE
|
||||
primary_connection_id = #{parentIdentifier,jdbcType=INTEGER}
|
||||
AND sharing_profile_name = #{name,jdbcType=VARCHAR}
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
<!-- Delete single sharing profile by identifier -->
|
||||
<delete id="delete">
|
||||
DELETE FROM [guacamole].[sharing_profile]
|
||||
DELETE FROM [dbo].[guacamole_sharing_profile]
|
||||
WHERE sharing_profile_id = #{identifier,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
|
||||
parameterType="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileModel">
|
||||
|
||||
INSERT INTO [guacamole].[sharing_profile] (
|
||||
INSERT INTO [dbo].[guacamole_sharing_profile] (
|
||||
sharing_profile_name,
|
||||
primary_connection_id
|
||||
)
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
<!-- Update single sharing profile -->
|
||||
<update id="update" parameterType="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileModel">
|
||||
UPDATE [guacamole].[sharing_profile]
|
||||
UPDATE [dbo].[guacamole_sharing_profile]
|
||||
SET sharing_profile_name = #{object.name,jdbcType=VARCHAR},
|
||||
primary_connection_id = #{object.parentIdentifier,jdbcType=INTEGER}
|
||||
WHERE sharing_profile_id = #{object.objectID,jdbcType=INTEGER}
|
||||
|
@@ -36,21 +36,21 @@
|
||||
sharing_profile_id,
|
||||
parameter_name,
|
||||
parameter_value
|
||||
FROM [guacamole].[sharing_profile_parameter]
|
||||
FROM [dbo].[guacamole_sharing_profile_parameter]
|
||||
WHERE
|
||||
sharing_profile_id = #{identifier,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<!-- Delete all parameters of a given sharing profile -->
|
||||
<delete id="delete">
|
||||
DELETE FROM [guacamole].[sharing_profile_parameter]
|
||||
DELETE FROM [dbo].[guacamole_sharing_profile_parameter]
|
||||
WHERE sharing_profile_id = #{identifier,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
<!-- Insert all given parameters -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileParameterModel">
|
||||
|
||||
INSERT INTO [guacamole].[sharing_profile_parameter] (
|
||||
INSERT INTO [dbo].[guacamole_sharing_profile_parameter] (
|
||||
sharing_profile_id,
|
||||
parameter_name,
|
||||
parameter_value
|
||||
|
@@ -35,16 +35,16 @@
|
||||
<select id="select" resultMap="PasswordRecordResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[user_password_history].user_id,
|
||||
[guacamole].[user_password_history].password_hash,
|
||||
[guacamole].[user_password_history].password_salt,
|
||||
[guacamole].[user_password_history].password_date
|
||||
FROM [guacamole].[user_password_history]
|
||||
JOIN [guacamole].[user] ON [guacamole].[user_password_history].user_id = [guacamole].[user].user_id
|
||||
[dbo].[guacamole_user_password_history].user_id,
|
||||
[dbo].[guacamole_user_password_history].password_hash,
|
||||
[dbo].[guacamole_user_password_history].password_salt,
|
||||
[dbo].[guacamole_user_password_history].password_date
|
||||
FROM [dbo].[guacamole_user_password_history]
|
||||
JOIN [dbo].[guacamole_user] ON [dbo].[guacamole_user_password_history].user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE
|
||||
[guacamole].[user].username = #{username,jdbcType=VARCHAR}
|
||||
[dbo].[guacamole_user].username = #{username,jdbcType=VARCHAR}
|
||||
ORDER BY
|
||||
[guacamole].[user_password_history].password_date DESC
|
||||
[dbo].[guacamole_user_password_history].password_date DESC
|
||||
LIMIT #{maxHistorySize}
|
||||
|
||||
</select>
|
||||
@@ -52,7 +52,7 @@
|
||||
<!-- Insert the given password record -->
|
||||
<insert id="insert" parameterType="org.apache.guacamole.auth.jdbc.user.PasswordRecordModel">
|
||||
|
||||
INSERT INTO [guacamole].[user_password_history] (
|
||||
INSERT INTO [dbo].[guacamole_user_password_history] (
|
||||
user_id,
|
||||
password_hash,
|
||||
password_salt,
|
||||
@@ -65,10 +65,10 @@
|
||||
#{record.passwordDate,jdbcType=TIMESTAMP}
|
||||
);
|
||||
|
||||
DELETE FROM [guacamole].[user_password_history]
|
||||
DELETE FROM [dbo].[guacamole_user_password_history]
|
||||
WHERE password_history_id IN (
|
||||
SELECT password_history_id
|
||||
FROM [guacamole].[user_password_history]
|
||||
FROM [dbo].[guacamole_user_password_history]
|
||||
WHERE user_id = #{record.userID,jdbcType=INTEGER}
|
||||
ORDER BY password_date DESC
|
||||
OFFSET #{maxHistorySize}
|
||||
|
@@ -46,16 +46,16 @@
|
||||
<!-- Select all usernames -->
|
||||
<select id="selectIdentifiers" resultType="string">
|
||||
SELECT username
|
||||
FROM [guacamole].[user]
|
||||
FROM [dbo].[guacamole_user]
|
||||
</select>
|
||||
|
||||
<!-- Select usernames of all readable users -->
|
||||
<select id="selectReadableIdentifiers" resultType="string">
|
||||
SELECT username
|
||||
FROM [guacamole].[user]
|
||||
JOIN [guacamole].[user_permission] ON affected_user_id = [guacamole].[user].user_id
|
||||
FROM [dbo].[guacamole_user]
|
||||
JOIN [dbo].[guacamole_user_permission] ON affected_user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE
|
||||
[guacamole].[user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
[dbo].[guacamole_user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
</select>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
email_address,
|
||||
organization,
|
||||
organizational_role
|
||||
FROM [guacamole].[user]
|
||||
FROM [dbo].[guacamole_user]
|
||||
WHERE username IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
@@ -92,7 +92,7 @@
|
||||
<select id="selectReadable" resultMap="UserResultMap">
|
||||
|
||||
SELECT
|
||||
[guacamole].[user].user_id,
|
||||
[dbo].[guacamole_user].user_id,
|
||||
username,
|
||||
password_hash,
|
||||
password_salt,
|
||||
@@ -108,14 +108,14 @@
|
||||
email_address,
|
||||
organization,
|
||||
organizational_role
|
||||
FROM [guacamole].[user]
|
||||
JOIN [guacamole].[user_permission] ON affected_user_id = [guacamole].[user].user_id
|
||||
FROM [dbo].[guacamole_user]
|
||||
JOIN [dbo].[guacamole_user_permission] ON affected_user_id = [dbo].[guacamole_user].user_id
|
||||
WHERE username IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
AND [guacamole].[user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND [dbo].[guacamole_user_permission].user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
|
||||
</select>
|
||||
@@ -140,7 +140,7 @@
|
||||
email_address,
|
||||
organization,
|
||||
organizational_role
|
||||
FROM [guacamole].[user]
|
||||
FROM [dbo].[guacamole_user]
|
||||
WHERE
|
||||
username = #{username,jdbcType=VARCHAR}
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
<!-- Delete single user by username -->
|
||||
<delete id="delete">
|
||||
DELETE FROM [guacamole].[user]
|
||||
DELETE FROM [dbo].[guacamole_user]
|
||||
WHERE username = #{identifier,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
|
||||
parameterType="org.apache.guacamole.auth.jdbc.user.UserModel">
|
||||
|
||||
INSERT INTO [guacamole].[user] (
|
||||
INSERT INTO [dbo].[guacamole_user] (
|
||||
username,
|
||||
password_hash,
|
||||
password_salt,
|
||||
@@ -195,7 +195,7 @@
|
||||
|
||||
<!-- Update single user -->
|
||||
<update id="update" parameterType="org.apache.guacamole.auth.jdbc.user.UserModel">
|
||||
UPDATE [guacamole].[user]
|
||||
UPDATE [dbo].[guacamole_user]
|
||||
SET password_hash = #{object.passwordHash,jdbcType=BINARY},
|
||||
password_salt = #{object.passwordSalt,jdbcType=BINARY},
|
||||
password_date = #{object.passwordDate,jdbcType=TIMESTAMP},
|
||||
|
Reference in New Issue
Block a user