001 package railo.runtime.security; 002 003 004 import railo.commons.io.res.Resource; 005 import railo.runtime.config.Config; 006 import railo.runtime.exp.PageException; 007 008 009 /** 010 * interface for Security Manager 011 */ 012 public interface SecurityManager { 013 014 public final static short ACCESS_OPEN = 1; 015 public final static short ACCESS_PROTECTED = 2; 016 public final static short ACCESS_CLOSE = 3; 017 018 /** 019 * Field <code>TYPE_SETTING</code> 020 */ 021 public final static int TYPE_SETTING = 0; 022 023 /** 024 * Field <code>TYPE_FILE</code> 025 */ 026 public final static int TYPE_FILE = 1; 027 028 /** 029 * Field <code>TYPE_DIRECT_JAVA_ACCESS</code> 030 */ 031 public final static int TYPE_DIRECT_JAVA_ACCESS = 2; 032 033 /** 034 * Field <code>TYPE_MAIL</code> 035 */ 036 public final static int TYPE_MAIL = 3; 037 038 /** 039 * Field <code>TYPE_DATASOURCE</code> 040 */ 041 public final static int TYPE_DATASOURCE = 4; 042 043 /** 044 * Field <code>TYPE_MAPPING</code> 045 */ 046 public final static int TYPE_MAPPING = 5; 047 048 /** 049 * Field <code>TYPE_CUSTOM_TAG</code> 050 */ 051 public final static int TYPE_CUSTOM_TAG = 6; 052 053 /** 054 * Field <code>TYPE_CFX_SETTING</code> 055 */ 056 public final static int TYPE_CFX_SETTING = 7; 057 058 /** 059 * Field <code>TYPE_CFX_USAGE</code> 060 */ 061 public final static int TYPE_CFX_USAGE = 8; 062 063 /** 064 * Field <code>TYPE_DEBUGGING</code> 065 */ 066 public final static int TYPE_DEBUGGING = 9; 067 068 /** 069 * Field <code>TYPE_TAG_EXECUTE</code> 070 */ 071 public static final int TYPE_TAG_EXECUTE = 10; 072 073 /** 074 * Field <code>TYPE_TAG_IMPORT</code> 075 */ 076 public static final int TYPE_TAG_IMPORT = 11; 077 078 /** 079 * Field <code>TYPE_TAG_OBJECT</code> 080 */ 081 public static final int TYPE_TAG_OBJECT = 12; 082 083 /** 084 * Field <code>TYPE_TAG_REGISTRY</code> 085 */ 086 public static final int TYPE_TAG_REGISTRY = 13; 087 088 /** 089 * Field <code>TYPE_SEARCH</code> 090 */ 091 public static final int TYPE_SEARCH = 14; 092 093 /** 094 * Field <code>TYPE_SCHEDULED_TASK</code> 095 */ 096 public static final int TYPE_SCHEDULED_TASK = 15; 097 098 public static final int TYPE_ACCESS_READ = 16; 099 public static final int TYPE_ACCESS_WRITE = 17; 100 public static final int TYPE_REMOTE = 18; 101 102 103 public static final int TYPE_CACHE = 19; 104 public static final int TYPE_GATEWAY = 20; 105 public static final int TYPE_ORM = 21; 106 107 /** 108 * Field <code>VALUE_NO</code> 109 */ 110 public final static short VALUE_NO = 0; 111 112 /** 113 * Field <code>VALUE_NONE</code> 114 */ 115 public final static short VALUE_NONE = 0; 116 117 /** 118 * Field <code>VALUE_LOCAL</code> 119 */ 120 public final static short VALUE_LOCAL = 1; 121 122 /** 123 * Field <code>VALUE_YES</code> 124 */ 125 public final static short VALUE_YES = 2; 126 127 /** 128 * Field <code>VALUE_ALL</code> 129 */ 130 public final static short VALUE_ALL = 2; 131 132 133 134 135 136 public final static short VALUE_1 = 11; 137 public final static short VALUE_2 = 12; 138 public final static short VALUE_3 = 13; 139 public final static short VALUE_4 = 14; 140 public final static short VALUE_5 = 15; 141 public final static short VALUE_6 = 16; 142 public final static short VALUE_7 = 17; 143 public final static short VALUE_8 = 18; 144 public final static short VALUE_9 = 19; 145 public final static short VALUE_10 = 20; 146 147 public final static short NUMBER_OFFSET = 10; 148 149 150 151 152 /** 153 * @param access 154 * @return return access value (all,local,none ...) for given type (cfx,file ...) 155 */ 156 public abstract short getAccess(int access); 157 158 /** 159 * @param access 160 * @return return access value (all,local,none ...) for given type (cfx,file ...) 161 * @throws PageException 162 */ 163 public abstract short getAccess(String access) throws PageException; 164 165 /** 166 * @param res 167 * @throws PageException 168 */ 169 public abstract void checkFileLocation(Resource res) throws PageException; 170 171 /** 172 * @param config 173 * @param res 174 * @param serverPassword 175 * @throws PageException 176 */ 177 public abstract void checkFileLocation(Config config, Resource res, String serverPassword) throws PageException; 178 179 /** 180 * @return clone the security Manager 181 */ 182 public abstract SecurityManager cloneSecurityManager(); 183 184 }