fix: [sync] Fixed a critical issue causing sharing groups to lose orgs/instance information on sync when using non sync users on a pull

pull/7091/head
iglocska 2021-02-24 20:45:19 +01:00
parent 044ddb33e3
commit add5882d8b
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 3 additions and 2 deletions

View File

@ -153,7 +153,6 @@ class SharingGroup extends AppModel
} else {
return array();
}
if ($scope === 'full') {
$sgs = $this->find('all', array(
'contain' => array('SharingGroupServer' => array('Server'), 'SharingGroupOrg' => array('Organisation'), 'Organisation'),
@ -164,7 +163,9 @@ class SharingGroup extends AppModel
} elseif ($scope === 'simplified') {
$fieldsOrg = array('id', 'name', 'uuid');
$fieldsServer = array('id', 'url', 'name');
$permissionTree = ($user['Role']['perm_site_admin'] || $user['Role']['perm_sync']) ? 1 : 0;
//$permissionTree = ($user['Role']['perm_site_admin'] || $user['Role']['perm_sync']) ? 1 : 0;
//Temporary fix: read only users used for pulling were stripping organisation data from sharing groups
$permissionTree = 1;
$fieldsSharingGroup = array(
array(
'fields' => array(