@@ -118,9 +118,16 @@ public function getMemberGroups($user, $vo)
118118
119119 public function getSpGroups ($ spEntityId )
120120 {
121+ $ facility = $ this ->connector ->searchForEntity (
122+ $ this ->ldapBase ,
123+ "(&(objectClass=perunFacility)(entityID= $ spEntityId)) " ,
124+ ['perunFacilityId ' ]
125+ );
126+
127+ $ id = $ facility ['perunFacilityId ' ][0 ];
121128 $ resources = $ this ->connector ->searchForEntities (
122129 $ this ->ldapBase ,
123- "(&(objectClass=perunResource)(entityID= $ spEntityId )) " ,
130+ "(&(objectClass=perunResource)(perunFacilityDn=perunFacilityId= $ id , $ this -> ldapBase )) " ,
124131 ["perunResourceId " , "assignedGroupId " , "perunVoId " ]
125132 );
126133
@@ -270,9 +277,16 @@ public function setUserExtSourceAttributes($userExtSourceId, $attributes)
270277
271278 public function getUsersGroupsOnFacility ($ spEntityId , $ userId )
272279 {
280+ $ facility = $ this ->connector ->searchForEntity (
281+ $ this ->ldapBase ,
282+ "(&(objectClass=perunFacility)(entityID= $ spEntityId)) " ,
283+ ['perunFacilityId ' ]
284+ );
285+
286+ $ id = $ facility ['perunFacilityId ' ][0 ];
273287 $ resources = $ this ->connector ->searchForEntities (
274288 $ this ->ldapBase ,
275- "(&(objectClass=perunResource)(entityID= $ spEntityId )) " ,
289+ "(&(objectClass=perunResource)(perunFacilityDn=perunFacilityId= $ id , $ this -> ldapBase )) " ,
276290 ["perunResourceId " ]
277291 );
278292 Logger::debug ("Resources - " . var_export ($ resources , true ));
0 commit comments