use of org.olat.modules.qpool.QuestionItemSecurityCallback in project OpenOLAT by OpenOLAT.
the class QPoolSecurityCallbackFactory method createQuestionItemSecurityCallback.
public QuestionItemSecurityCallback createQuestionItemSecurityCallback(QuestionItemView itemView, QuestionItemsSource questionItemSource, Roles roles) {
QuestionItemSecurityCallback securityCallback;
if (qpoolModule.isReviewProcessEnabled()) {
securityCallback = CoreSpringFactory.getImpl(ReviewProcessSecurityCallback.class);
} else {
securityCallback = CoreSpringFactory.getImpl(ProcesslessSecurityCallback.class);
}
securityCallback.setQuestionItemView(itemView);
securityCallback.setQuestionItemSource(questionItemSource);
securityCallback.setAdmin(roles.isOLATAdmin());
securityCallback.setPoolAdmin(roles.isPoolAdmin());
return securityCallback;
}
use of org.olat.modules.qpool.QuestionItemSecurityCallback in project openolat by klemens.
the class AbstractItemListController method wrapNewItem.
protected ItemRow wrapNewItem(QuestionItem item) {
ItemWrapper itemWrapper = ItemWrapper.builder(item).setAuthor(true).create();
QuestionItemSecurityCallback securityCallback = qpoolSecurityCallbackFactory.createQuestionItemSecurityCallback(itemWrapper, getSource(), roles);
return new ItemRow(itemWrapper, securityCallback);
}
use of org.olat.modules.qpool.QuestionItemSecurityCallback in project openolat by klemens.
the class QPoolSecurityCallbackFactory method createQuestionItemSecurityCallback.
public QuestionItemSecurityCallback createQuestionItemSecurityCallback(QuestionItemView itemView, QuestionItemsSource questionItemSource, Roles roles) {
QuestionItemSecurityCallback securityCallback;
if (qpoolModule.isReviewProcessEnabled()) {
securityCallback = CoreSpringFactory.getImpl(ReviewProcessSecurityCallback.class);
} else {
securityCallback = CoreSpringFactory.getImpl(ProcesslessSecurityCallback.class);
}
securityCallback.setQuestionItemView(itemView);
securityCallback.setQuestionItemSource(questionItemSource);
securityCallback.setAdmin(roles.isOLATAdmin());
securityCallback.setPoolAdmin(roles.isPoolAdmin());
return securityCallback;
}
use of org.olat.modules.qpool.QuestionItemSecurityCallback in project OpenOLAT by OpenOLAT.
the class AbstractItemListController method wrapNewItem.
protected ItemRow wrapNewItem(QuestionItem item) {
ItemWrapper itemWrapper = ItemWrapper.builder(item).setAuthor(true).create();
QuestionItemSecurityCallback securityCallback = qpoolSecurityCallbackFactory.createQuestionItemSecurityCallback(itemWrapper, getSource(), roles);
return new ItemRow(itemWrapper, securityCallback);
}
use of org.olat.modules.qpool.QuestionItemSecurityCallback in project OpenOLAT by OpenOLAT.
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