Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
import java.util.concurrent.CompletableFuture;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;

import org.exoplatform.commons.cache.future.FutureCache;
import org.exoplatform.commons.cache.future.FutureExoCache;
import org.exoplatform.commons.cache.future.Loader;
import org.exoplatform.commons.file.services.FileService;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.RootContainer.PortalContainerPostCreateTask;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.cache.CachedObjectSelector;
import org.exoplatform.services.cache.ExoCache;
Expand Down Expand Up @@ -65,6 +65,8 @@ public class ProgramCachedStorage extends ProgramStorage {

public static final String PROGRAM_CACHE_NAME = "gamification.domain";

private UserACL userAcl;

private FutureExoCache<Long, ProgramDTO, Object> programFutureCache;

private FutureCache<Object, List<String>, Object> administratorsRetrivalTask;
Expand Down Expand Up @@ -218,10 +220,9 @@ public void postDelete(User user) throws Exception {
@ContainerTransactional
public void clearCachedAdministrator(User user) {
if (administrators != null
&& user != null
&& (administrators.stream().anyMatch(u -> StringUtils.equals(u, user.getUserName()))
|| CollectionUtils.isNotEmpty(organizationService.getMembershipHandler()
.findMembershipsByUserAndGroup(user.getUserName(),
Utils.REWARDING_GROUP)))) {
|| userAcl.getUserIdentity(user.getUserName()).isMemberOf(Utils.REWARDING_GROUP))) {
administrators = null;
}
}
Expand Down