diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java index 7080590ae..0fd2643c9 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/contentsections/ConfigurationDocumentTypesController.java @@ -18,13 +18,11 @@ */ package org.librecms.ui.contentsections; -import org.libreccm.api.IdentifierParser; import org.libreccm.l10n.GlobalizationHelper; import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedTextsUtil; import org.libreccm.security.AuthorizationRequired; import org.libreccm.security.PermissionChecker; -import org.libreccm.security.PermissionManager; import org.libreccm.security.Role; import org.libreccm.workflow.Workflow; import org.librecms.contentsection.ContentSection; diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeModel.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeModel.java deleted file mode 100644 index 4272ee969..000000000 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/DocumentTypeModel.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2021 LibreCCM Foundation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -package org.librecms.ui.contentsections; - - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.enterprise.context.RequestScoped; -import javax.inject.Named; - -/** - * Model for the details view of a document type. - * - * @author Jens Pelzetter - */ -@RequestScoped -@Named("CmsDocumentTypeModel") -public class DocumentTypeModel { - - /** - * The display name of the type. - */ - private String displayName; - - /** - * The class implementing the type. - */ - private String contentItemClass; - - /** - * The localized labels of the type. - */ - private Map labels; - - /** - * The localized descriptions of the type. - */ - private Map descriptions; - - /** - * The lifecycles of the type. - */ - private List lifecycles; - - /** - * The workflows of the type. - */ - private List workflows; - - public String getContentItemClass() { - return contentItemClass; - } - - public void setContentItemClass(final String contentItemClass) { - this.contentItemClass = contentItemClass; - } - - public Map getLabels() { - return Collections.unmodifiableMap(labels); - } - - public void setLabels(final Map labels) { - this.labels = new HashMap<>(labels); - } - - public Map getDescriptions() { - return Collections.unmodifiableMap(descriptions); - } - - public void setDescriptions(final Map descriptions) { - this.descriptions = new HashMap<>(descriptions); - } - - public List getLifecycles() { - return Collections.unmodifiableList(lifecycles); - } - - public void setLifecycles( - final List lifecyles - ) { - this.lifecycles = new ArrayList<>(lifecyles); - } - - public List getWorkflows() { - return Collections.unmodifiableList(workflows); - } - - public void setWorkflows(final List workflows) { - this.workflows = new ArrayList<>(workflows); - } - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - -} diff --git a/ccm-cms/src/main/java/org/librecms/ui/contentsections/TypePermissionsChecker.java b/ccm-cms/src/main/java/org/librecms/ui/contentsections/TypePermissionsChecker.java deleted file mode 100644 index e10fe9f5c..000000000 --- a/ccm-cms/src/main/java/org/librecms/ui/contentsections/TypePermissionsChecker.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2021 LibreCCM Foundation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -package org.librecms.ui.contentsections; - -import org.libreccm.security.PermissionChecker; -import org.librecms.contentsection.ContentType; -import org.librecms.contentsection.privileges.TypePrivileges; - -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -/** - * Checks permissions on content types. - * - * @author Jens Pelzetter - */ -@RequestScoped -public class TypePermissionsChecker { - - /** - * {@link PermissionChecker} instance used for performing the permission - * check. - */ - @Inject - private PermissionChecker permissionChecker; - - /** - * Checks if the current user is permitted to use the provided - * {@link ContentType}. - * - * @param type The content type. - * - * @return {@code true} if the current user is permitted to use the provided - * {@code type}, {@code false} otherwise. - */ - public boolean canUseType(final ContentType type) { - return permissionChecker.isPermitted( - TypePrivileges.USE_TYPE, type - ); - } - -}