DragonByte Tech
Well-known member
- Affected version
- 2.0.7
Based off of the functionality of the
However, that is not what's happening. Instead, it inserts the
I would fix this issue by changing the relevant query to this:
What this will do is copy the existing int permission if the given depend permission is an int permission, or use
Fillip
applyGlobalPermission
function, I expected that applyGlobalPermissionInt
would copy the current int permission value of a given $dependGroupId
and $dependPermissionId
.However, that is not what's happening. Instead, it inserts the
$applyValue
only if the user group has "allow" for a given Flag permission (based off $dependGroupId
and $dependPermissionId
).I would fix this issue by changing the relevant query to this:
SQL:
REPLACE INTO xf_permission_entry
(user_group_id, user_id, permission_group_id, permission_id, permission_value, permission_value_int)
SELECT user_group_id, user_id, ?, ?, 'use_int', IF(permission_value = 'use_int', permission_value_int, ?)
FROM xf_permission_entry
WHERE permission_group_id = ?
AND permission_id = ?
AND permission_value IN('allow', 'use_int')
$applyValue
if it is not. This maintains existing behaviour (apply the value to user groups with the given permission) while also allowing for the use of int permission copy.Fillip