1 64 65 package com.jcorporate.expresso.services.controller.dbmaint; 66 67 import com.jcorporate.expresso.core.ExpressoSchema; 68 import com.jcorporate.expresso.core.controller.ControllerException; 69 import com.jcorporate.expresso.core.controller.ControllerRequest; 70 import com.jcorporate.expresso.core.controller.ControllerResponse; 71 import com.jcorporate.expresso.core.controller.NonHandleableException; 72 import com.jcorporate.expresso.core.dataobjects.DataObject; 73 import com.jcorporate.expresso.core.dataobjects.Securable; 74 import com.jcorporate.expresso.core.db.DBException; 75 import com.jcorporate.expresso.core.dbobj.SecuredDBObject; 76 import com.jcorporate.expresso.core.misc.StringUtil; 77 import com.jcorporate.expresso.core.security.User; 78 import com.jcorporate.expresso.services.dbobj.Setup; 79 80 85 public class List 86 extends ListBase { 87 public List() { 88 } 89 90 96 public List(String code, String descrip) { 97 super(code, descrip); 98 } 99 100 106 public void run(ControllerRequest req, ControllerResponse res) 107 throws NonHandleableException, ControllerException { 108 super.run(req, res); 109 110 DataObject myDBObj = this.getDataObject(); 111 showNext = true; 112 showPrev = true; 113 114 try { 115 if (myDBObj instanceof Securable) { 116 ((Securable) myDBObj).isAllowed("S"); 117 } else { 118 if (getUid() == SecuredDBObject.SYSTEM_ACCOUNT 119 || User.getUserFromId(getUid(), this.getControllerRequest().getDataContext()).isAdmin()) { 120 } else { 122 String allowInsecure = Setup.getValue(req.getDataContext(), 123 ExpressoSchema.class.getName(), 124 "insecureDBMaint"); 125 if (!(StringUtil.toBoolean(allowInsecure))) { 126 throw new SecurityException ("Access to unsecured Objects not allowed"); 127 } 128 } 129 } 130 showList(); 131 } catch (DBException de) { 132 throw new ControllerException(de); 133 } 134 } 135 136 137 } 138 139 | Popular Tags |