Changeset 19638
- Timestamp:
- 02/03/12 11:22:46 (4 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 1 deleted
- 16 edited
-
Jav_Commons/src/com/scenari/s/fw/properties/loaders/xml/BshScriptInitApp.java (modified) (4 diffs)
-
Jav_Commons/src/eu/scenari/commons/extpoints/ExtPoints.java (modified) (1 diff)
-
Jav_Commons/src/eu/scenari/commons/extpoints/ExtPointsSaxHandler.java (added)
-
Jav_Commons/src/eu/scenari/commons/security/PermRegRoot.java (modified) (2 diffs)
-
Jav_Commons/src/eu/scenari/commons/security/ScSecurityException.java (added)
-
Jav_Core/src/com/scenari/m/co/dialog/webdav/HSDialogWebdav.java (modified) (2 diffs)
-
Jav_Core/src/com/scenari/m/co/service/sourcedav/HSDialogSourceDav.java (modified) (3 diffs)
-
Jav_Core/src/com/scenari/m/co/univers/XParamUniversSaxHandler.java (modified) (3 diffs)
-
Jav_Core/src/com/scenari/s/co/sourcerel/fs/HSourceRelFsWithRights.java (modified) (13 diffs)
-
Jav_Src/src/com/scenari/src/ISrcContent.java (modified) (2 diffs)
-
Jav_Src/src/com/scenari/src/NotAllowedException.java (deleted)
-
Jav_Src/src/com/scenari/src/aspect/ISrcAspectable.java (modified) (2 diffs)
-
Jav_Src/src/com/scenari/src/helpers/lnk/SrcNodeLnkFrontEndRestrictRights.java (modified) (14 diffs)
-
Jav_Src/src/com/scenari/src/helpers/util/SrcContentRestrictRights.java (modified) (13 diffs)
-
Jav_Src/src/com/scenari/src/helpers/util/SrcNodeFrontEndRestrictRights.java (modified) (14 diffs)
-
Jav_Src/src/com/scenari/src/helpers/util/SrcNodeRestrictRights.java (modified) (2 diffs)
-
Jav_Wsp/src/com/scenari/m/bdp/item/fs/WspSrcNodeRoot.java (modified) (2 diffs)
-
Jav_Wsp/src/com/scenari/m/bdp/service/tabitemtype/SvcItemTypePermReg.java (modified) (1 diff)
-
Jav_WspOdb/src/eu/scenari/wspodb/wsp/src/OdbReadOnlySrcNode.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_Commons/src/com/scenari/s/fw/properties/loaders/xml/BshScriptInitApp.java
r18986 r19638 1 package com.scenari.s.fw.properties.loaders.xml;2 3 1 /* 4 2 * LICENCE[[ … … 39 37 * ]]LICENCE 40 38 */ 39 package com.scenari.s.fw.properties.loaders.xml; 41 40 42 41 import java.io.File; … … 49 48 50 49 /** 51 * Permet l'ex ecution d'un script BSH à l'initialisation d'une application.50 * Permet l'exécution d'un script BSH à l'initialisation d'une application. 52 51 * 53 52 * Pour ce faire, il faut déclarer un nouveau tag dans le processus d'inititalisation ainsi: … … 55 54 * 56 55 * puis exploiter ce tag : 57 * [bsh][! [CDATA[56 * [bsh][!CDATA[ 58 57 * System.out.println("test"); 59 * ]] ][/bsh]58 * ]][/bsh] 60 59 */ 61 60 public class BshScriptInitApp extends HInitAppSaxHandlerBase { -
trunk/Jav_Commons/src/eu/scenari/commons/extpoints/ExtPoints.java
r19623 r19638 269 269 if (vResult == Boolean.TRUE) return; 270 270 if (vResult == null) LogMgr.publishTrace("Permission '%s' not configured for roles : %s", LogType.Warning, pPerm, pRoles); 271 throw new ScSecurityException(pPerm); 271 272 } 272 273 -
trunk/Jav_Commons/src/eu/scenari/commons/security/PermRegRoot.java
r19623 r19638 42 42 public interface PermRegRoot { 43 43 44 //##### Permission root 45 44 46 public static final IPermission DO = PermissionMgr.GLOBAL.getOrCreate("do", null); 47 48 //##### Permissions de haut niveau 45 49 46 50 public static final IPermission READ = PermissionMgr.GLOBAL.getOrCreate("read", DO); … … 51 55 52 56 public static final IPermission ADMIN = PermissionMgr.GLOBAL.getOrCreate("admin", DO); 57 58 //##### Permissions de deuxième niveau 59 60 public static final IPermission CREATE = PermissionMgr.GLOBAL.getOrCreate("create", WRITE); 61 62 public static final IPermission DELETE = PermissionMgr.GLOBAL.getOrCreate("delete", WRITE); 63 64 public static final IPermission UPDATE = PermissionMgr.GLOBAL.getOrCreate("update", WRITE); 65 66 public static final IPermission COPY = PermissionMgr.GLOBAL.getOrCreate("copy", WRITE); 67 68 public static final IPermission MOVE = PermissionMgr.GLOBAL.getOrCreate("move", WRITE); 53 69 } -
trunk/Jav_Core/src/com/scenari/m/co/dialog/webdav/HSDialogWebdav.java
r18986 r19638 39 39 package com.scenari.m.co.dialog.webdav; 40 40 41 import com.scenari.src.NotAllowedException;42 41 43 42 import eu.scenari.commons.log.LogMgr; 44 43 import eu.scenari.commons.log.LogMsg; 45 44 import eu.scenari.commons.log.ILogMsg.LogType; 45 import eu.scenari.commons.security.ScSecurityException; 46 46 import eu.scenari.core.dialog.IDialog; 47 47 import eu.scenari.core.execframe.IExecFrame; … … 275 275 } 276 276 277 } catch ( NotAllowedException e) {277 } catch (ScSecurityException e) { 278 278 fPageResultatDav = new WResultatError(HWebdavCodes.SC_FORBIDDEN); 279 279 ((WResultatError) fPageResultatDav).hSetLogMessage(LogMgr.getMessage(e)); -
trunk/Jav_Core/src/com/scenari/m/co/service/sourcedav/HSDialogSourceDav.java
r18986 r19638 55 55 import com.scenari.src.ISrcContent; 56 56 import com.scenari.src.ISrcNode; 57 import com.scenari.src.NotAllowedException;58 57 import com.scenari.src.feature.copymove.SrcFeatureCopyMove; 59 58 import com.scenari.src.feature.paths.SrcFeaturePaths; … … 64 63 import eu.scenari.commons.log.LogMgr; 65 64 import eu.scenari.commons.mime.MimeMgr; 65 import eu.scenari.commons.security.ScSecurityException; 66 66 import eu.scenari.core.dialog.IDialog; 67 67 import eu.scenari.core.service.IService; … … 506 506 //Creation du résultat 507 507 fPageResultatDav = new WResultatSimpleStatus((vStatutDst == ISrcNode.STATUS_NONE) ? HWebdavCodes.SC_CREATED : HWebdavCodes.SC_NO_CONTENT); 508 } catch ( NotAllowedException e) {508 } catch (ScSecurityException e) { 509 509 fPageResultatDav = new WResultatError(HWebdavCodes.SC_FORBIDDEN, LogMgr.getMessage(e)); 510 510 } catch (Exception e) { -
trunk/Jav_Core/src/com/scenari/m/co/univers/XParamUniversSaxHandler.java
r19119 r19638 54 54 import com.scenari.src.system.SrcSystemFactory; 55 55 56 import eu.scenari.commons.extpoints.ExtPointsSaxHandler; 56 57 import eu.scenari.commons.log.LogMgr; 58 import eu.scenari.commons.util.xml.FragmentSaxHandlerBase; 57 59 import eu.scenari.core.execframe.httpservlet.ExecFrameHttpServletLoader; 58 60 import eu.scenari.core.service.ISvcLoader; … … 79 81 80 82 public static final String TAG_SERVICE_ATT_CODE = "code"; 83 84 public static final String TAG_EXTPOINTS = "extPoints"; 81 85 82 86 public static final String TAG_COMPOSANT = "composant"; … … 369 373 LogMgr.publishException(e, "Echec à l'installation du service '" + vCode + " de type '" + vType + "' à partir de : '" + fCurrentDocSource + "'."); 370 374 } 375 } 376 377 // 378 else if (pLocalName == TAG_EXTPOINTS) { 379 FragmentSaxHandlerBase vSaxHandler = new ExtPointsSaxHandler(fUnivers.getExtPoints()); 380 vSaxHandler.initSaxHandlerForElement(fXMLReader, pUri, pLocalName, pQName, pAttributes); 371 381 } 372 382 -
trunk/Jav_Core/src/com/scenari/s/co/sourcerel/fs/HSourceRelFsWithRights.java
r18983 r19638 44 44 45 45 import com.scenari.src.ISrcNode; 46 import com.scenari.src.NotAllowedException;47 46 import com.scenari.src.aspect.ISrcAspectDef; 48 47 import com.scenari.src.feature.rights.IAccessRightsAspect; 49 48 import com.scenari.src.feature.rights.SrcFeatureRights; 50 49 import com.scenari.src.helpers.lnk.ISrcNodeLnk; 50 51 import eu.scenari.commons.security.ScSecurityException; 51 52 52 53 /** … … 110 111 return vResult; 111 112 } else { 112 throw new NotAllowedException();113 throw new ScSecurityException(pDefinition.rightsToCheck()); 113 114 } 114 115 } … … 151 152 */ 152 153 public List<ISrcNode> listChildrenNodes(List<ISrcNode> pListToAppend) throws Exception { 153 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) { throw new NotAllowedException(); }154 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) { throw new ScSecurityException(); } 154 155 return super.listChildrenNodes(pListToAppend); 155 156 } … … 159 160 */ 160 161 public InputStream newInputStream(boolean pEnsureBuffered) throws Exception { 161 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new NotAllowedException(); }162 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); } 162 163 return super.newInputStream(pEnsureBuffered); 163 164 } … … 167 168 */ 168 169 public long getTreeLastModif() throws Exception { 169 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0 || (fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) { throw new NotAllowedException(); }170 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0 || (fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) { throw new ScSecurityException(); } 170 171 return super.getTreeLastModif(); 171 172 } … … 175 176 */ 176 177 public long getLastModif() throws Exception { 177 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new NotAllowedException(); }178 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); } 178 179 return super.getLastModif(); 179 180 } … … 183 184 */ 184 185 public long getContentSize() throws Exception { 185 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new NotAllowedException(); }186 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); } 186 187 return super.getContentSize(); 187 188 } … … 191 192 */ 192 193 public int getContentStatus() throws Exception { 193 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new NotAllowedException(); }194 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); } 194 195 return super.getContentStatus(); 195 196 } … … 199 200 */ 200 201 public List listChildrenNames(List pListToAppend, int pStatusChilds) throws Exception { 201 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) { throw new NotAllowedException(); }202 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_LISTCHILDREN); } 202 203 return super.listChildrenNames(pListToAppend, pStatusChilds); 203 204 } … … 207 208 */ 208 209 public OutputStream newOutputStream(boolean pEnsureBuffered) throws Exception { 209 if ((fRightsAllowed & SrcFeatureRights.RIGHT_WRITE) == 0) { throw new NotAllowedException(); }210 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0 && !fElem.exists()) { throw new NotAllowedException(); }210 if ((fRightsAllowed & SrcFeatureRights.RIGHT_WRITE) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); } 211 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0 && !fElem.exists()) { throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFILE); } 211 212 return super.newOutputStream(pEnsureBuffered); 212 213 } … … 216 217 */ 217 218 public boolean createAsFile() throws Exception { 218 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0) { throw new NotAllowedException(); }219 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFILE); } 219 220 return super.createAsFile(); 220 221 } … … 224 225 */ 225 226 public boolean createAsFolder() throws Exception { 226 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFOLDER) == 0) { throw new NotAllowedException(); }227 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFOLDER) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFOLDER); } 227 228 return super.createAsFolder(); 228 229 } … … 232 233 */ 233 234 public boolean removeSrc() throws Exception { 234 if ((fRightsAllowed & SrcFeatureRights.RIGHT_REMOVE) == 0) { throw new NotAllowedException(); }235 if ((fRightsAllowed & SrcFeatureRights.RIGHT_REMOVE) == 0) { throw new ScSecurityException(SrcFeatureRights.RIGHT_REMOVE); } 235 236 return super.removeSrc(); 236 237 } -
trunk/Jav_Src/src/com/scenari/src/ISrcContent.java
r17211 r19638 53 53 import com.scenari.src.helpers.util.SrcContentNull; 54 54 55 import eu.scenari.commons.security.ScSecurityException; 56 55 57 /** 56 58 * <p>Source de contenu anonyme.</p> … … 83 85 * <p>Si l'implémentation de cette source gère un système d'autorisation d'accès 84 86 * et qu'une action intentée est refusée, une exception 85 * {@link NotAllowedException} doit être levée.</p>87 * {@link ScSecurityException} doit être levée.</p> 86 88 */ 87 89 public interface ISrcContent extends ISrcAspectable { -
trunk/Jav_Src/src/com/scenari/src/aspect/ISrcAspectable.java
r14602 r19638 39 39 package com.scenari.src.aspect; 40 40 41 import com.scenari.src.NotAllowedException;41 import eu.scenari.commons.security.ScSecurityException; 42 42 43 43 /** … … 51 51 * @param pDefinition Définition de l'aspect demandé. 52 52 * @return L'apsect ou null si cet aspect n'est pas disponible pour cet objet. 53 * @throws NotAllowedException Si les droits d'accès n'autorisent pas d'accéder à cet aspect.53 * @throws ScSecurityException Si les droits d'accès n'autorisent pas d'accéder à cet aspect. 54 54 */ 55 55 public <T> T getAspect(ISrcAspectDef<T> pDefinition) throws Exception; -
trunk/Jav_Src/src/com/scenari/src/helpers/lnk/SrcNodeLnkFrontEndRestrictRights.java
r17211 r19638 45 45 import com.scenari.src.ISrcNode; 46 46 import com.scenari.src.ISrcServer; 47 import com.scenari.src.NotAllowedException;48 47 import com.scenari.src.aspect.ISrcAspectDef; 49 48 import com.scenari.src.feature.rights.IAccessRightsAspect; 50 49 import com.scenari.src.feature.rights.SrcFeatureRights; 50 51 import eu.scenari.commons.security.ScSecurityException; 51 52 52 53 /** … … 79 80 return vResult; 80 81 } else { 81 throw new NotAllowedException();82 throw new ScSecurityException(pDefinition.rightsToCheck()); 82 83 } 83 84 } … … 103 104 */ 104 105 public List<ISrcNode> listChildrenNodes(List<ISrcNode> pListToAppend) throws Exception { 105 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new NotAllowedException();106 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_LISTCHILDREN); 106 107 return super.listChildrenNodes(pListToAppend); 107 108 } … … 111 112 */ 112 113 public InputStream newInputStream(boolean pEnsureBuffered) throws Exception { 113 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();114 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); 114 115 return super.newInputStream(pEnsureBuffered); 115 116 } … … 119 120 */ 120 121 public long getTreeLastModif() throws Exception { 121 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0 || (fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new NotAllowedException();122 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0 || (fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new ScSecurityException(); 122 123 return super.getTreeLastModif(); 123 124 } … … 127 128 */ 128 129 public long getLastModif() throws Exception { 129 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();130 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); 130 131 return super.getLastModif(); 131 132 } … … 135 136 */ 136 137 public long getContentSize() throws Exception { 137 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();138 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); 138 139 return super.getContentSize(); 139 140 } … … 143 144 */ 144 145 public String getContentType() throws Exception { 145 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();146 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); 146 147 return super.getContentType(); 147 148 } … … 151 152 */ 152 153 public int getContentStatus() throws Exception { 153 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();154 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_READ); 154 155 return super.getContentStatus(); 155 156 } … … 159 160 */ 160 161 public List listChildrenNames(List pListToAppend, int pStatusChilds) throws Exception { 161 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new NotAllowedException();162 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_LISTCHILDREN); 162 163 return super.listChildrenNames(pListToAppend, pStatusChilds); 163 164 } … … 167 168 */ 168 169 public OutputStream newOutputStream(boolean pEnsureBuffered) throws Exception { 169 if ((fRightsAllowed & SrcFeatureRights.RIGHT_WRITE) == 0) throw new NotAllowedException();170 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0 && fSrcContent.getContentStatus() == ISrcNode.STATUS_NONE) { throw new NotAllowedException(); }170 if ((fRightsAllowed & SrcFeatureRights.RIGHT_WRITE) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 171 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0 && fSrcContent.getContentStatus() == ISrcNode.STATUS_NONE) { throw new ScSecurityException(); } 171 172 return super.newOutputStream(pEnsureBuffered); 172 173 } … … 176 177 */ 177 178 public boolean createAsFile() throws Exception { 178 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0) throw new NotAllowedException();179 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFILE); 179 180 return super.createAsFile(); 180 181 } … … 184 185 */ 185 186 public boolean createAsFolder() throws Exception { 186 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFOLDER) == 0) throw new NotAllowedException();187 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFOLDER) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFOLDER); 187 188 return super.createAsFolder(); 188 189 } … … 192 193 */ 193 194 public boolean removeSrc() throws Exception { 194 if ((fRightsAllowed & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new NotAllowedException();195 if ((fRightsAllowed & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new ScSecurityException(SrcFeatureRights.RIGHT_REMOVE); 195 196 return super.removeSrc(); 196 197 } -
trunk/Jav_Src/src/com/scenari/src/helpers/util/SrcContentRestrictRights.java
r17211 r19638 44 44 45 45 import com.scenari.src.ISrcContent; 46 import com.scenari.src.NotAllowedException;47 46 import com.scenari.src.aspect.ISrcAspectDef; 48 47 import com.scenari.src.feature.rights.IAccessRightsAspect; 49 48 import com.scenari.src.feature.rights.SrcFeatureRights; 49 50 import eu.scenari.commons.security.ScSecurityException; 50 51 51 52 /** … … 77 78 return vResult; 78 79 } else { 79 throw new NotAllowedException();80 throw new ScSecurityException(); 80 81 } 81 82 } … … 106 107 public String getContentType() throws Exception { 107 108 if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getContentType(); } 108 throw new NotAllowedException();109 throw new ScSecurityException(); 109 110 } 110 111 … … 114 115 public InputStream newInputStream(boolean pEnsureBuffered) throws Exception { 115 116 if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.newInputStream(pEnsureBuffered); } 116 throw new NotAllowedException();117 throw new ScSecurityException(); 117 118 } 118 119 … … 122 123 public long getLastModif() throws Exception { 123 124 if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getLastModif(); } 124 throw new NotAllowedException();125 throw new ScSecurityException(); 125 126 } 126 127 … … 130 131 public long getTreeLastModif() throws Exception { 131 132 if (SrcFeatureRights.isAllowed(this, SrcFeatureRights.RIGHT_READ | SrcFeatureRights.RIGHT_LISTCHILDREN)) { return fSubSource.getTreeLastModif(); } 132 throw new NotAllowedException();133 throw new ScSecurityException(); 133 134 } 134 135 … … 138 139 public List listChildrenNames(List pListToAppend, int pStatusChilds) throws Exception { 139 140 if ((fRights & SrcFeatureRights.RIGHT_LISTCHILDREN) != 0) { return fSubSource.listChildrenNames(pListToAppend, pStatusChilds); } 140 throw new NotAllowedException();141 throw new ScSecurityException(); 141 142 142 143 } … … 147 148 public OutputStream newOutputStream(boolean pEnsureBuffered) throws Exception { 148 149 if ((fRights & SrcFeatureRights.RIGHT_WRITE) != 0) { return fSubSource.newOutputStream(pEnsureBuffered); } 149 throw new NotAllowedException();150 throw new ScSecurityException(); 150 151 } 151 152 … … 162 163 public long getContentSize() throws Exception { 163 164 if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getContentSize(); } 164 throw new NotAllowedException();165 throw new ScSecurityException(); 165 166 166 167 } … … 171 172 public int getContentStatus() throws Exception { 172 173 if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getContentStatus(); } 173 throw new NotAllowedException();174 throw new ScSecurityException(); 174 175 } 175 176 … … 179 180 public boolean createAsFile() throws Exception { 180 181 if ((fRights & SrcFeatureRights.RIGHT_CREATEFILE) != 0) { return fSubSource.createAsFile(); } 181 throw new NotAllowedException();182 throw new ScSecurityException(); 182 183 } 183 184 … … 187 188 public boolean createAsFolder() throws Exception { 188 189 if ((fRights & SrcFeatureRights.RIGHT_CREATEFOLDER) != 0) { return fSubSource.createAsFolder(); } 189 throw new NotAllowedException();190 throw new ScSecurityException(); 190 191 } 191 192 … … 197 198 case ISrcContent.STATUS_FILE: 198 199 case ISrcContent.STATUS_FOLDER: { 199 if ((fRights & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new NotAllowedException();200 if ((fRights & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new ScSecurityException(); 200 201 return fSubSource.removeSrc(); 201 202 } -
trunk/Jav_Src/src/com/scenari/src/helpers/util/SrcNodeFrontEndRestrictRights.java
r17211 r19638 46 46 import com.scenari.src.ISrcNode; 47 47 import com.scenari.src.ISrcServer; 48 import com.scenari.src.NotAllowedException;49 48 import com.scenari.src.aspect.ISrcAspectDef; 50 49 import com.scenari.src.feature.rights.IAccessRightsAspect; 51 50 import com.scenari.src.feature.rights.SrcFeatureRights; 51 52 import eu.scenari.commons.security.ScSecurityException; 52 53 53 54 /** … … 83 84 return vResult; 84 85 } else { 85 throw new NotAllowedException();86 throw new ScSecurityException(); 86 87 } 87 88 } … … 112 113 */ 113 114 public List<ISrcNode> listChildrenNodes(List<ISrcNode> pListToAppend) throws Exception { 114 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new NotAllowedException();115 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new ScSecurityException(); 115 116 return super.listChildrenNodes(pListToAppend); 116 117 } … … 120 121 */ 121 122 public InputStream newInputStream(boolean pEnsureBuffered) throws Exception { 122 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();123 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(); 123 124 return super.newInputStream(pEnsureBuffered); 124 125 } … … 128 129 */ 129 130 public long getTreeLastModif() throws Exception { 130 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0 || (fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new NotAllowedException();131 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0 || (fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new ScSecurityException(); 131 132 return super.getTreeLastModif(); 132 133 } … … 136 137 */ 137 138 public long getLastModif() throws Exception { 138 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();139 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(); 139 140 return super.getLastModif(); 140 141 } … … 144 145 */ 145 146 public long getContentSize() throws Exception { 146 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();147 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(); 147 148 return super.getContentSize(); 148 149 } … … 152 153 */ 153 154 public String getContentType() throws Exception { 154 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();155 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(); 155 156 return super.getContentType(); 156 157 } … … 160 161 */ 161 162 public int getContentStatus() throws Exception { 162 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new NotAllowedException();163 if ((fRightsAllowed & SrcFeatureRights.RIGHT_READ) == 0) throw new ScSecurityException(); 163 164 return super.getContentStatus(); 164 165 } … … 168 169 */ 169 170 public List listChildrenNames(List pListToAppend, int pStatusChilds) throws Exception { 170 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new NotAllowedException();171 if ((fRightsAllowed & SrcFeatureRights.RIGHT_LISTCHILDREN) == 0) throw new ScSecurityException(); 171 172 return super.listChildrenNames(pListToAppend, pStatusChilds); 172 173 } … … 176 177 */ 177 178 public OutputStream newOutputStream(boolean pEnsureBuffered) throws Exception { 178 if ((fRightsAllowed & SrcFeatureRights.RIGHT_WRITE) == 0) throw new NotAllowedException();179 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0 && fCachedSrcContent.getContentStatus() == ISrcNode.STATUS_NONE) { throw new NotAllowedException(); }179 if ((fRightsAllowed & SrcFeatureRights.RIGHT_WRITE) == 0) throw new ScSecurityException(); 180 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0 && fCachedSrcContent.getContentStatus() == ISrcNode.STATUS_NONE) { throw new ScSecurityException(); } 180 181 return super.newOutputStream(pEnsureBuffered); 181 182 } … … 185 186 */ 186 187 public boolean createAsFile() throws Exception { 187 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0) throw new NotAllowedException();188 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFILE) == 0) throw new ScSecurityException(); 188 189 return super.createAsFile(); 189 190 } … … 193 194 */ 194 195 public boolean createAsFolder() throws Exception { 195 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFOLDER) == 0) throw new NotAllowedException();196 if ((fRightsAllowed & SrcFeatureRights.RIGHT_CREATEFOLDER) == 0) throw new ScSecurityException(); 196 197 return super.createAsFolder(); 197 198 } … … 201 202 */ 202 203 public boolean removeSrc() throws Exception { 203 if ((fRightsAllowed & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new NotAllowedException();204 if ((fRightsAllowed & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new ScSecurityException(); 204 205 return super.removeSrc(); 205 206 } -
trunk/Jav_Src/src/com/scenari/src/helpers/util/SrcNodeRestrictRights.java
r17139 r19638 45 45 import com.scenari.src.ISrcNode; 46 46 import com.scenari.src.ISrcServer; 47 import com.scenari.src.NotAllowedException;48 47 import com.scenari.src.aspect.ISrcAspectDef; 49 48 import com.scenari.src.feature.paths.IPathResolverAspect; 50 49 import com.scenari.src.feature.paths.SrcFeaturePaths; 51 50 import com.scenari.src.feature.rights.SrcFeatureRights; 51 52 import eu.scenari.commons.security.ScSecurityException; 52 53 53 54 /** … … 147 148 return pListToAppend; 148 149 } 149 throw new NotAllowedException();150 throw new ScSecurityException(); 150 151 } 151 152 -
trunk/Jav_Wsp/src/com/scenari/m/bdp/item/fs/WspSrcNodeRoot.java
r19365 r19638 40 40 41 41 import com.scenari.src.ISrcNode; 42 import com.scenari.src.NotAllowedException;43 42 import com.scenari.src.aspect.ISrcAspectDef; 44 43 import com.scenari.src.feature.tasks.ISrcTask; 45 44 import com.scenari.src.feature.tasks.ISrcTaskMgr; 46 45 46 import eu.scenari.commons.security.ScSecurityException; 47 47 import eu.scenari.commons.util.lang.TunneledException; 48 48 … … 70 70 71 71 public boolean removeSrc() throws Exception { 72 throw new NotAllowedException();72 throw new ScSecurityException(); 73 73 } 74 74 -
trunk/Jav_Wsp/src/com/scenari/m/bdp/service/tabitemtype/SvcItemTypePermReg.java
r19623 r19638 43 43 import eu.scenari.commons.security.PermissionMgr; 44 44 45 public interfaceSvcItemTypePermReg {45 public abstract class SvcItemTypePermReg { 46 46 47 public static final IPermission SHOWSTATE = PermissionMgr.GLOBAL.getOrCreate("dialog.itemtype# showState", PermRegRoot.ADMIN);47 public static final IPermission SHOWSTATE = PermissionMgr.GLOBAL.getOrCreate("dialog.itemtype#ShowState", PermRegRoot.ADMIN); 48 48 49 public static final IPermission COMPILE = PermissionMgr.GLOBAL.getOrCreate("dialog.itemtype# compile", PermRegRoot.ADMIN);49 public static final IPermission COMPILE = PermissionMgr.GLOBAL.getOrCreate("dialog.itemtype#Compile", PermRegRoot.ADMIN); 50 50 } -
trunk/Jav_WspOdb/src/eu/scenari/wspodb/wsp/src/OdbReadOnlySrcNode.java
r17761 r19638 44 44 45 45 import com.scenari.src.ISrcNode; 46 import com.scenari.src.NotAllowedException;47 46 import com.scenari.src.aspect.ISrcAspectDef; 48 47 import com.scenari.src.feature.copymove.SrcFeatureCopyMove.IIfTargetExistBehavior; … … 50 49 import com.scenari.src.feature.rights.SrcFeatureRights; 51 50 51 import eu.scenari.commons.security.ScSecurityException; 52 52 import eu.scenari.wspodb.wsp.OdbWspDefinition; 53 53 … … 72 72 73 73 public void copyFrom(ISrcNode pFrom, IIfTargetExistBehavior pIfTargetExist, Object... pOptions) throws Exception { 74 throw new NotAllowedException();74 throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 75 75 } 76 76 77 77 public void moveFrom(ISrcNode pFrom, IIfTargetExistBehavior pIfTargetExist, Object... pOptions) throws Exception { 78 throw new NotAllowedException();78 throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 79 79 } 80 80 81 81 public boolean createAsFile() throws Exception { 82 throw new NotAllowedException();82 throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFILE); 83 83 } 84 84 85 85 public boolean createAsFolder() throws Exception { 86 throw new NotAllowedException();86 throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFOLDER); 87 87 } 88 88 89 89 public OutputStream newOutputStream(boolean pEnsureBuffered) throws Exception { 90 throw new NotAllowedException();90 throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 91 91 } 92 92 93 93 public boolean removeSrc() throws Exception { 94 94 //XXX Utiliser pour suppression définitive (history, trash, snapshot...) ? 95 throw new NotAllowedException();95 throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 96 96 } 97 97
Note: See TracChangeset
for help on using the changeset viewer.