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 * Field <code>VALUE_NO</code> 104 */ 105 public final static short VALUE_NO = 0; 106 107 /** 108 * Field <code>VALUE_NONE</code> 109 */ 110 public final static short VALUE_NONE = 0; 111 112 /** 113 * Field <code>VALUE_LOCAL</code> 114 */ 115 public final static short VALUE_LOCAL = 1; 116 117 /** 118 * Field <code>VALUE_YES</code> 119 */ 120 public final static short VALUE_YES = 2; 121 122 /** 123 * Field <code>VALUE_ALL</code> 124 */ 125 public final static short VALUE_ALL = 2; 126 127 128 129 130 131 public final static short VALUE_1 = 11; 132 public final static short VALUE_2 = 12; 133 public final static short VALUE_3 = 13; 134 public final static short VALUE_4 = 14; 135 public final static short VALUE_5 = 15; 136 public final static short VALUE_6 = 16; 137 public final static short VALUE_7 = 17; 138 public final static short VALUE_8 = 18; 139 public final static short VALUE_9 = 19; 140 public final static short VALUE_10 = 20; 141 142 public final static short NUMBER_OFFSET = 10; 143 144 145 146 147 /** 148 * @param access 149 * @return return access value (all,local,none ...) for given type (cfx,file ...) 150 */ 151 public abstract short getAccess(int access); 152 153 /** 154 * @param access 155 * @return return access value (all,local,none ...) for given type (cfx,file ...) 156 * @throws PageException 157 */ 158 public abstract short getAccess(String access) throws PageException; 159 160 /** 161 * @param res 162 * @throws PageException 163 */ 164 public abstract void checkFileLocation(Resource res) throws PageException; 165 166 /** 167 * @param config 168 * @param res 169 * @param serverPassword 170 * @throws PageException 171 */ 172 public abstract void checkFileLocation(Config config, Resource res, String serverPassword) throws PageException; 173 174 /** 175 * @return clone the security Manager 176 */ 177 public abstract SecurityManager cloneSecurityManager(); 178 179 }