@@ -85,8 +85,10 @@ public static function getUserById($userId, $checkExists = true){
85
85
// Try to get from cache
86
86
$ test = CacheService::fetch (AJXP_CACHE_SERVICE_NS_SHARED , "pydio:user: " . $ userId );
87
87
if ($ test !== false && $ test instanceof UserInterface){
88
- // Second check : if roles were updated in cache
88
+ // Second check : if roles were updated in cache, or maybe profile with auto-apply feature
89
89
$ roleCacheIds = array_map (function ($ k ){ return "pydio:role: " .$ k ; }, $ test ->getRolesKeys ());
90
+ $ profile = $ test ->getProfile ();
91
+ if (!empty ($ profile )) $ roleCacheIds [] = "pydio:profile: " .$ profile ;
90
92
$ test = CacheService::fetchWithTimestamps (AJXP_CACHE_SERVICE_NS_SHARED , "pydio:user: " .$ userId , $ roleCacheIds );
91
93
if ($ test !== false ){
92
94
if ($ test ->getPersonalRole () === null ){
@@ -180,6 +182,17 @@ public static function getRepositoriesForUser($user, $includeShared = true, $det
180
182
181
183
}
182
184
185
+ /**
186
+ * @param string $userId
187
+ * @param RepositoryInterface[] $repoList
188
+ */
189
+ private function setInCache ($ userId , $ repoList ){
190
+
191
+ $ this ->repositoriesCache [$ userId ] = $ repoList ;
192
+ SessionService::updateLoadedRepositories ($ repoList );
193
+
194
+ }
195
+
183
196
/**
184
197
* @param $userId
185
198
* @return mixed|null|\Pydio\Core\Model\RepositoryInterface[]
@@ -203,17 +216,6 @@ private function getFromCaches($userId){
203
216
204
217
}
205
218
206
- /**
207
- * @param string $userId
208
- * @param RepositoryInterface[] $repoList
209
- */
210
- private function setInCache ($ userId , $ repoList ){
211
-
212
- $ this ->repositoriesCache [$ userId ] = $ repoList ;
213
- SessionService::updateLoadedRepositories ($ repoList );
214
-
215
- }
216
-
217
219
public static function invalidateCache (){
218
220
219
221
self ::instance ()->repositoriesCache = [];
0 commit comments