/**
* Returns the label groups for all accessible categories.
*
+ * @param string $permission
* @return ViewableLabelGroup[]
*/
- public static function getAccessibleLabelGroups() {
+ public static function getAccessibleLabelGroups($permission = 'canSetLabel') {
$labelGroupsToCategories = ArticleCategoryLabelCacheBuilder::getInstance()->getData();
$accessibleCategoryIDs = self::getAccessibleCategoryIDs();
}
if (empty($groupIDs)) return [];
- return LabelHandler::getInstance()->getLabelGroups(array_unique($groupIDs));
+ return LabelHandler::getInstance()->getLabelGroups(array_unique($groupIDs), true, $permission);
}
}
parent::readParameters();
// read available label groups
- $this->labelGroups = ArticleCategory::getAccessibleLabelGroups();
+ $this->labelGroups = ArticleCategory::getAccessibleLabelGroups('canViewLabel');
if (!empty($this->labelGroups) && isset($_REQUEST['labelIDs']) && is_array($_REQUEST['labelIDs'])) {
$this->labelIDs = $_REQUEST['labelIDs'];