fix: [Tagging] Fixed the user/org restrictions not being adhered to when tagging

pull/5390/head
iglocska 2019-11-06 21:17:53 +01:00
parent 28028869da
commit 48b30c5095
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 10 additions and 4 deletions

View File

@ -327,10 +327,16 @@ class Tag extends AppModel
} else {
if (
!$user['Role']['perm_site_admin'] &&
$existingTag['Tag']['org_id'] != 0 &&
$existingTag['Tag']['org_id'] != $user['org_id'] &&
$existingTag['Tag']['user_id'] != 0 &&
$existingTag['Tag']['user_id'] != $user['id']
(
(
$existingTag['Tag']['org_id'] != 0 &&
$existingTag['Tag']['org_id'] != $user['org_id']
) ||
(
$existingTag['Tag']['user_id'] != 0 &&
$existingTag['Tag']['user_id'] != $user['id']
)
)
) {
return false;
}