001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kns.document.authorization;
017
018import org.kuali.rice.kns.document.MaintenanceDocument;
019import org.kuali.rice.krad.bo.BusinessObject;
020import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
021
022import java.util.HashSet;
023import java.util.Set;
024
025/**
026 * Base class for all MaintenanceDocumentPresentationControllers.
027 */
028public class MaintenanceDocumentPresentationControllerBase extends DocumentPresentationControllerBase
029       implements MaintenanceDocumentPresentationController {
030
031    public boolean canCreate(Class boClass) {
032        return KRADServiceLocatorWeb.getDocumentDictionaryService().getAllowsNewOrCopy(
033                KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentTypeName(boClass));
034    }
035
036    public boolean canMaintain(Object dataObject) {
037        return true;
038    }
039
040    public Set<String> getConditionallyHiddenPropertyNames(BusinessObject businessObject) {
041        return new HashSet<String>();
042    }
043
044    public Set<String> getConditionallyHiddenSectionIds(BusinessObject businessObject) {
045        return new HashSet<String>();
046    }
047
048    @Override
049    public Set<String> getConditionallyReadOnlyPropertyNames(MaintenanceDocument document) {
050        return new HashSet<String>();
051    }
052
053    @Override
054    public Set<String> getConditionallyReadOnlySectionIds(MaintenanceDocument document) {
055        return new HashSet<String>();
056    }
057
058    @Override
059    public Set<String> getConditionallyRequiredPropertyNames(MaintenanceDocument document) {
060        return new HashSet<String>();
061    }
062}