Skip to content

Commit

Permalink
SAK-31857 dont load hidden sites from preferences when loading synopt…
Browse files Browse the repository at this point in the history
…ic announcements (sakaiproject#3467)
  • Loading branch information
ottenhoff authored Oct 19, 2016
1 parent 2417ebc commit 65006f6
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,18 +357,18 @@ public String makeReference(String siteId)
class EntryProvider extends MergedListEntryProviderBase
{
/** announcement channels from hidden sites */
private final List excludedSites = new ArrayList();
private final List<String> hiddenSites = new ArrayList<String>();

public EntryProvider() {
this(false);
}

public EntryProvider(boolean excludeHiddenSites) {
if (excludeHiddenSites) {
public EntryProvider(boolean includeHiddenSites) {
if (includeHiddenSites) {
List<String> excludedSiteIds = getExcludedSitesFromTabs();
if (excludedSiteIds != null) {
for (String siteId : excludedSiteIds) {
excludedSites.add(AnnouncementService.channelReference(siteId, SiteService.MAIN_CONTAINER));
hiddenSites.add(AnnouncementService.channelReference(siteId, SiteService.MAIN_CONTAINER));
}
}
}
Expand Down Expand Up @@ -413,7 +413,7 @@ public boolean allowGet(String ref)
SecurityAdvisor advisor = getChannelAdvisor(ref);
try {
m_securityService.pushAdvisor(advisor);
return (!excludedSites.contains(ref) && AnnouncementService.allowGetChannel(ref));
return (!hiddenSites.contains(ref) && AnnouncementService.allowGetChannel(ref));
} finally {
m_securityService.popAdvisor(advisor);
}
Expand Down Expand Up @@ -1576,7 +1576,7 @@ private List getMessages(AnnouncementChannel defaultChannel, Filter filter, bool
}
}
mergedAnnouncementList.loadChannelsFromDelimitedString(isOnWorkspaceTab(), new MergedListEntryProviderFixedListWrapper(
new EntryProvider(true), state.getChannelId(), channelArrayFromConfigParameterValue,
new EntryProvider(false), state.getChannelId(), channelArrayFromConfigParameterValue,
new AnnouncementReferenceToChannelConverter()), StringUtil.trimToZero(SessionManager
.getCurrentSessionUserId()), channelArrayFromConfigParameterValue, m_securityService.isSuperUser(),
ToolManager.getCurrentPlacement().getContext());
Expand Down Expand Up @@ -4499,7 +4499,7 @@ protected void initState(SessionState state, VelocityPortlet portlet, JetspeedRu
}

mergedAnnouncementList.loadChannelsFromDelimitedString(isOnWorkspaceTab(), new MergedListEntryProviderFixedListWrapper(
new EntryProvider(true), annState.getChannelId(), channelArrayFromConfigParameterValue,
new EntryProvider(false), annState.getChannelId(), channelArrayFromConfigParameterValue,
new AnnouncementReferenceToChannelConverter()),
StringUtil.trimToZero(SessionManager.getCurrentSessionUserId()), channelArrayFromConfigParameterValue,
m_securityService.isSuperUser(), ToolManager.getCurrentPlacement().getContext());
Expand Down

0 comments on commit 65006f6

Please sign in to comment.