Skip to content

Commit

Permalink
DASH-328 check item availablity first before adding dashboard links
Browse files Browse the repository at this point in the history
git-svn-id: https://source.sakaiproject.org/svn/dashboard/trunk@315026 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
zqian committed Oct 30, 2014
1 parent dbf4b1e commit 07be7d7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public void addCalendarLinks(String sakaiUserId, String contextId) {
for(CalendarItem item: items) {
SourceType sourceType = item.getSourceType();
DashboardEntityInfo dashboardEntityInfo = this.dashboardEntityInfoMap.get(sourceType.getIdentifier());
if(dashboardEntityInfo != null && dashboardEntityInfo.isUserPermitted(sakaiUserId, item.getEntityReference(), item.getContext().getContextId())) {
if(dashboardEntityInfo != null && dashboardEntityInfo.isAvailable(item.getEntityReference()) && dashboardEntityInfo.isUserPermitted(sakaiUserId, item.getEntityReference(), item.getContext().getContextId())) {
CalendarLink calendarLink = new CalendarLink(person, item, item.getContext(), false, false);
calendarLinks.add(calendarLink);
}
Expand Down Expand Up @@ -328,7 +328,7 @@ public void addNewsLinks(String sakaiUserId, String contextId) {
for(NewsItem item: items) {
SourceType sourceType = item.getSourceType();
DashboardEntityInfo dashboardEntityInfo = this.dashboardEntityInfoMap.get(sourceType.getIdentifier());
if(dashboardEntityInfo != null && dashboardEntityInfo.isUserPermitted(sakaiUserId, item.getEntityReference(), item.getContext().getContextId()) ) {
if(dashboardEntityInfo != null && dashboardEntityInfo.isAvailable(item.getEntityReference()) && dashboardEntityInfo.isUserPermitted(sakaiUserId, item.getEntityReference(), item.getContext().getContextId()) ) {
NewsLink newsLink = new NewsLink(person, item, item.getContext(), false, false);
newsLinks.add(newsLink);
}
Expand Down

0 comments on commit 07be7d7

Please sign in to comment.