Search in sources :

Example 1 with QuestionItemSecurityCallback

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;
}
Also used : QuestionItemSecurityCallback(org.olat.modules.qpool.QuestionItemSecurityCallback)

Example 2 with QuestionItemSecurityCallback

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);
}
Also used : ItemWrapper(org.olat.modules.qpool.model.ItemWrapper) QuestionItemSecurityCallback(org.olat.modules.qpool.QuestionItemSecurityCallback)

Example 3 with QuestionItemSecurityCallback

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;
}
Also used : QuestionItemSecurityCallback(org.olat.modules.qpool.QuestionItemSecurityCallback)

Example 4 with QuestionItemSecurityCallback

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);
}
Also used : ItemWrapper(org.olat.modules.qpool.model.ItemWrapper) QuestionItemSecurityCallback(org.olat.modules.qpool.QuestionItemSecurityCallback)

Example 5 with QuestionItemSecurityCallback

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", "&nbsp;", 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;
}
Also used : FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) QuestionItemSecurityCallback(org.olat.modules.qpool.QuestionItemSecurityCallback) ResourceLicense(org.olat.core.commons.services.license.ResourceLicense)

Aggregations

QuestionItemSecurityCallback (org.olat.modules.qpool.QuestionItemSecurityCallback)6 ResourceLicense (org.olat.core.commons.services.license.ResourceLicense)2 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)2 ItemWrapper (org.olat.modules.qpool.model.ItemWrapper)2