|  1 |     | 
     | 
  |  2 |     | 
     | 
  |  3 |     | 
     | 
  |  4 |     | 
     | 
  |  5 |     | 
     | 
  |  6 |     | 
     | 
  |  7 |     | 
     | 
  |  8 |     | 
     | 
  |  9 |     | 
     | 
  |  10 |     | 
     | 
  |  11 |     | 
     | 
  |  12 |     | 
     | 
  |  13 |     | 
     | 
  |  14 |     | 
     | 
  |  15 |     | 
     | 
  |  16 |     | 
   package org.kuali.rice.kns.uif.authorization;  | 
  |  17 |     | 
     | 
  |  18 |     | 
   import org.kuali.rice.kns.document.Document;  | 
  |  19 |     | 
   import org.kuali.rice.kns.service.KNSServiceLocatorWeb;  | 
  |  20 |     | 
   import org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService;  | 
  |  21 |     | 
   import org.kuali.rice.kns.workflow.service.KualiWorkflowDocument;  | 
  |  22 |     | 
     | 
  |  23 |     | 
     | 
  |  24 |     | 
     | 
  |  25 |     | 
     | 
  |  26 |    0 |    public class MaintenanceDocumentPresentationControllerBase extends DocumentPresentationControllerBase { | 
  |  27 |     | 
     | 
  |  28 |     | 
       protected static MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService;  | 
  |  29 |     | 
     | 
  |  30 |     | 
       public boolean canCreate(Class<?> dataObjectClass) { | 
  |  31 |    0 |            return getMaintenanceDocumentDictionaryService().getAllowsNewOrCopy(  | 
  |  32 |     | 
                   getMaintenanceDocumentDictionaryService().getDocumentTypeName(dataObjectClass)).booleanValue();  | 
  |  33 |     | 
       }  | 
  |  34 |     | 
     | 
  |  35 |     | 
       @Override  | 
  |  36 |     | 
       protected boolean canSave(Document document) { | 
  |  37 |    0 |            KualiWorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();  | 
  |  38 |     | 
     | 
  |  39 |    0 |            return (!workflowDocument.stateIsEnroute() && super.canSave(document));  | 
  |  40 |     | 
       }  | 
  |  41 |     | 
     | 
  |  42 |     | 
       @Override  | 
  |  43 |     | 
       protected boolean canBlanketApprove(Document document) { | 
  |  44 |    0 |            KualiWorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();  | 
  |  45 |     | 
     | 
  |  46 |    0 |            return (!workflowDocument.stateIsEnroute() && super.canBlanketApprove(document));  | 
  |  47 |     | 
       }  | 
  |  48 |     | 
     | 
  |  49 |     | 
       protected MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService() { | 
  |  50 |    0 |            if (maintenanceDocumentDictionaryService == null) { | 
  |  51 |    0 |                maintenanceDocumentDictionaryService = KNSServiceLocatorWeb.getMaintenanceDocumentDictionaryService();  | 
  |  52 |     | 
           }  | 
  |  53 |    0 |            return maintenanceDocumentDictionaryService;  | 
  |  54 |     | 
       }  | 
  |  55 |     | 
     | 
  |  56 |     | 
   }  |