mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-220: Take group "disabled" flag into account when determining effective groups. Do not inherit from nor apply disabled groups.
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
* SQL fragment which tests whether the value of the given column matches
|
* SQL fragment which tests whether the value of the given column matches
|
||||||
* the given entity ID. If group identifiers are provided, the IDs of the
|
* the given entity ID. If group identifiers are provided, the IDs of the
|
||||||
* entities for all groups having those identifiers are tested, as well.
|
* entities for all groups having those identifiers are tested, as well.
|
||||||
|
* Disabled groups are ignored.
|
||||||
*
|
*
|
||||||
* @param column
|
* @param column
|
||||||
* The name of the column to test. This column MUST contain an entity
|
* The name of the column to test. This column MUST contain an entity
|
||||||
@@ -45,8 +46,9 @@
|
|||||||
${column} = ${entityID}
|
${column} = ${entityID}
|
||||||
<if test="!${groups}.isEmpty()">
|
<if test="!${groups}.isEmpty()">
|
||||||
OR ${column} IN (
|
OR ${column} IN (
|
||||||
SELECT entity_id
|
SELECT guacamole_entity.entity_id
|
||||||
FROM guacamole_entity
|
FROM guacamole_entity
|
||||||
|
JOIN guacamole_user_group ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||||
WHERE
|
WHERE
|
||||||
type = 'USER_GROUP'::guacamole_entity_type
|
type = 'USER_GROUP'::guacamole_entity_type
|
||||||
AND name IN
|
AND name IN
|
||||||
@@ -54,6 +56,7 @@
|
|||||||
open="(" separator="," close=")">
|
open="(" separator="," close=")">
|
||||||
#{effectiveGroup,jdbcType=VARCHAR}
|
#{effectiveGroup,jdbcType=VARCHAR}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
AND disabled = false
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
)
|
)
|
||||||
@@ -69,11 +72,13 @@
|
|||||||
JOIN guacamole_user_group_member ON guacamole_user_group.user_group_id = guacamole_user_group_member.user_group_id
|
JOIN guacamole_user_group_member ON guacamole_user_group.user_group_id = guacamole_user_group_member.user_group_id
|
||||||
WHERE
|
WHERE
|
||||||
guacamole_user_group_member.member_entity_id = #{entity.entityID}
|
guacamole_user_group_member.member_entity_id = #{entity.entityID}
|
||||||
|
AND guacamole_user_group.disabled = false
|
||||||
<if test="!effectiveGroups.isEmpty()">
|
<if test="!effectiveGroups.isEmpty()">
|
||||||
UNION
|
UNION
|
||||||
SELECT
|
SELECT
|
||||||
guacamole_entity.entity_id
|
guacamole_entity.entity_id
|
||||||
FROM guacamole_entity
|
FROM guacamole_entity
|
||||||
|
JOIN guacamole_user_group ON guacamole_user_group.entity_id = guacamole_entity.entity_id
|
||||||
WHERE
|
WHERE
|
||||||
type = 'USER_GROUP'::guacamole_entity_type
|
type = 'USER_GROUP'::guacamole_entity_type
|
||||||
AND name IN
|
AND name IN
|
||||||
@@ -81,6 +86,7 @@
|
|||||||
open="(" separator="," close=")">
|
open="(" separator="," close=")">
|
||||||
#{effectiveGroup,jdbcType=VARCHAR}
|
#{effectiveGroup,jdbcType=VARCHAR}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
AND guacamole_user_group.disabled = false
|
||||||
</if>
|
</if>
|
||||||
UNION
|
UNION
|
||||||
SELECT
|
SELECT
|
||||||
@@ -88,6 +94,8 @@
|
|||||||
FROM related_entity
|
FROM related_entity
|
||||||
JOIN guacamole_user_group_member ON related_entity.entity_id = guacamole_user_group_member.member_entity_id
|
JOIN guacamole_user_group_member ON related_entity.entity_id = guacamole_user_group_member.member_entity_id
|
||||||
JOIN guacamole_user_group ON guacamole_user_group.user_group_id = guacamole_user_group_member.user_group_id
|
JOIN guacamole_user_group ON guacamole_user_group.user_group_id = guacamole_user_group_member.user_group_id
|
||||||
|
WHERE
|
||||||
|
guacamole_user_group.disabled = false
|
||||||
)
|
)
|
||||||
SELECT name
|
SELECT name
|
||||||
FROM related_entity
|
FROM related_entity
|
||||||
|
Reference in New Issue
Block a user