Search in sources :

Example 1 with BGRight

use of org.olat.course.groupsandrights.BGRightsRow.BGRight in project OpenOLAT by OpenOLAT.

the class GroupsAndRightsController method fillCheckbox.

private void fillCheckbox(BGRightsRow groupRights, List<String> permissions) {
    List<BGRight> selections = new ArrayList<>();
    for (String permission : CourseRights.getAvailableRights()) {
        BGRight permissionEl = new BGRight(permission);
        boolean selected = permissions == null ? false : permissions.contains(permission);
        MultipleSelectionElement selection = createSelection(selected);
        permissionEl.setSelection(selection);
        selection.setUserObject(permissionEl);
        selections.add(permissionEl);
    }
    groupRights.setRightsEl(selections);
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) ArrayList(java.util.ArrayList) BGRight(org.olat.course.groupsandrights.BGRightsRow.BGRight)

Example 2 with BGRight

use of org.olat.course.groupsandrights.BGRightsRow.BGRight in project openolat by klemens.

the class GroupsAndRightsController method fillCheckbox.

private void fillCheckbox(BGRightsRow groupRights, List<String> permissions) {
    List<BGRight> selections = new ArrayList<>();
    for (String permission : CourseRights.getAvailableRights()) {
        BGRight permissionEl = new BGRight(permission);
        boolean selected = permissions == null ? false : permissions.contains(permission);
        MultipleSelectionElement selection = createSelection(selected);
        permissionEl.setSelection(selection);
        selection.setUserObject(permissionEl);
        selections.add(permissionEl);
    }
    groupRights.setRightsEl(selections);
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) ArrayList(java.util.ArrayList) BGRight(org.olat.course.groupsandrights.BGRightsRow.BGRight)

Aggregations

ArrayList (java.util.ArrayList)2 MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)2 BGRight (org.olat.course.groupsandrights.BGRightsRow.BGRight)2