use of org.olat.modules.qpool.QuestionItemSecurityCallback in project openolat by klemens.
the class AbstractItemListController method forgeRow.
protected ItemRow forgeRow(QuestionItemView item, List<ResourceLicense> licenses) {
boolean marked = item.isMarked();
QuestionItemSecurityCallback securityCallback = qpoolSecurityCallbackFactory.createQuestionItemSecurityCallback(item, getSource(), roles);
ItemRow row = new ItemRow(item, securityCallback);
// favorite
FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", " ", null, null, Link.NONTRANSLATED);
markLink.setIconLeftCSS(marked ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
markLink.setUserObject(row);
row.setMarkLink(markLink);
// license
for (ResourceLicense license : licenses) {
if (license.getResId().equals(item.getResourceableId()) && license.getResName().equals(item.getResourceableTypeName())) {
row.setLicense(license);
}
}
return row;
}
Aggregations