Changeset 19638


Ignore:
Timestamp:
02/03/12 11:22:46 (4 months ago)
Author:
sys
Message:

Sécurité côté serveur en cours...

Location:
trunk
Files:
2 added
1 deleted
16 edited

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  
    31/* 
    42 * LICENCE[[ 
     
    3937 * ]]LICENCE 
    4038 */ 
     39package com.scenari.s.fw.properties.loaders.xml; 
    4140 
    4241import java.io.File; 
     
    4948 
    5049/** 
    51  * Permet l'execution d'un script BSH à l'initialisation d'une application. 
     50 * Permet l'exécution d'un script BSH à l'initialisation d'une application. 
    5251 *  
    5352 * Pour ce faire, il faut déclarer un nouveau tag dans le processus d'inititalisation ainsi: 
     
    5554 *  
    5655 * puis exploiter ce tag : 
    57  * [bsh][![CDATA[ 
     56 * [bsh][!CDATA[ 
    5857 *   System.out.println("test"); 
    59  * ]]][/bsh] 
     58 * ]][/bsh] 
    6059 */ 
    6160public class BshScriptInitApp extends HInitAppSaxHandlerBase { 
  • trunk/Jav_Commons/src/eu/scenari/commons/extpoints/ExtPoints.java

    r19623 r19638  
    269269                if (vResult == Boolean.TRUE) return; 
    270270                if (vResult == null) LogMgr.publishTrace("Permission '%s' not configured for roles : %s", LogType.Warning, pPerm, pRoles); 
     271                throw new ScSecurityException(pPerm); 
    271272        } 
    272273 
  • trunk/Jav_Commons/src/eu/scenari/commons/security/PermRegRoot.java

    r19623 r19638  
    4242public interface PermRegRoot { 
    4343 
     44        //##### Permission root 
     45 
    4446        public static final IPermission DO = PermissionMgr.GLOBAL.getOrCreate("do", null); 
     47 
     48        //##### Permissions de haut niveau 
    4549 
    4650        public static final IPermission READ = PermissionMgr.GLOBAL.getOrCreate("read", DO); 
     
    5155 
    5256        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); 
    5369} 
  • trunk/Jav_Core/src/com/scenari/m/co/dialog/webdav/HSDialogWebdav.java

    r18986 r19638  
    3939package com.scenari.m.co.dialog.webdav; 
    4040 
    41 import com.scenari.src.NotAllowedException; 
    4241 
    4342import eu.scenari.commons.log.LogMgr; 
    4443import eu.scenari.commons.log.LogMsg; 
    4544import eu.scenari.commons.log.ILogMsg.LogType; 
     45import eu.scenari.commons.security.ScSecurityException; 
    4646import eu.scenari.core.dialog.IDialog; 
    4747import eu.scenari.core.execframe.IExecFrame; 
     
    275275                        } 
    276276 
    277                 } catch (NotAllowedException e) { 
     277                } catch (ScSecurityException e) { 
    278278                        fPageResultatDav = new WResultatError(HWebdavCodes.SC_FORBIDDEN); 
    279279                        ((WResultatError) fPageResultatDav).hSetLogMessage(LogMgr.getMessage(e)); 
  • trunk/Jav_Core/src/com/scenari/m/co/service/sourcedav/HSDialogSourceDav.java

    r18986 r19638  
    5555import com.scenari.src.ISrcContent; 
    5656import com.scenari.src.ISrcNode; 
    57 import com.scenari.src.NotAllowedException; 
    5857import com.scenari.src.feature.copymove.SrcFeatureCopyMove; 
    5958import com.scenari.src.feature.paths.SrcFeaturePaths; 
     
    6463import eu.scenari.commons.log.LogMgr; 
    6564import eu.scenari.commons.mime.MimeMgr; 
     65import eu.scenari.commons.security.ScSecurityException; 
    6666import eu.scenari.core.dialog.IDialog; 
    6767import eu.scenari.core.service.IService; 
     
    506506                        //Creation du résultat 
    507507                        fPageResultatDav = new WResultatSimpleStatus((vStatutDst == ISrcNode.STATUS_NONE) ? HWebdavCodes.SC_CREATED : HWebdavCodes.SC_NO_CONTENT); 
    508                 } catch (NotAllowedException e) { 
     508                } catch (ScSecurityException e) { 
    509509                        fPageResultatDav = new WResultatError(HWebdavCodes.SC_FORBIDDEN, LogMgr.getMessage(e)); 
    510510                } catch (Exception e) { 
  • trunk/Jav_Core/src/com/scenari/m/co/univers/XParamUniversSaxHandler.java

    r19119 r19638  
    5454import com.scenari.src.system.SrcSystemFactory; 
    5555 
     56import eu.scenari.commons.extpoints.ExtPointsSaxHandler; 
    5657import eu.scenari.commons.log.LogMgr; 
     58import eu.scenari.commons.util.xml.FragmentSaxHandlerBase; 
    5759import eu.scenari.core.execframe.httpservlet.ExecFrameHttpServletLoader; 
    5860import eu.scenari.core.service.ISvcLoader; 
     
    7981 
    8082        public static final String TAG_SERVICE_ATT_CODE = "code"; 
     83 
     84        public static final String TAG_EXTPOINTS = "extPoints"; 
    8185 
    8286        public static final String TAG_COMPOSANT = "composant"; 
     
    369373                                LogMgr.publishException(e, "Echec à l'installation du service '" + vCode + " de type '" + vType + "' à partir de : '" + fCurrentDocSource + "'."); 
    370374                        } 
     375                } 
     376 
     377                // 
     378                else if (pLocalName == TAG_EXTPOINTS) { 
     379                        FragmentSaxHandlerBase vSaxHandler = new ExtPointsSaxHandler(fUnivers.getExtPoints()); 
     380                        vSaxHandler.initSaxHandlerForElement(fXMLReader, pUri, pLocalName, pQName, pAttributes); 
    371381                } 
    372382 
  • trunk/Jav_Core/src/com/scenari/s/co/sourcerel/fs/HSourceRelFsWithRights.java

    r18983 r19638  
    4444 
    4545import com.scenari.src.ISrcNode; 
    46 import com.scenari.src.NotAllowedException; 
    4746import com.scenari.src.aspect.ISrcAspectDef; 
    4847import com.scenari.src.feature.rights.IAccessRightsAspect; 
    4948import com.scenari.src.feature.rights.SrcFeatureRights; 
    5049import com.scenari.src.helpers.lnk.ISrcNodeLnk; 
     50 
     51import eu.scenari.commons.security.ScSecurityException; 
    5152 
    5253/** 
     
    110111                                return vResult; 
    111112                        } else { 
    112                                 throw new NotAllowedException(); 
     113                                throw new ScSecurityException(pDefinition.rightsToCheck()); 
    113114                        } 
    114115                } 
     
    151152         */ 
    152153        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(); } 
    154155                return super.listChildrenNodes(pListToAppend); 
    155156        } 
     
    159160         */ 
    160161        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); } 
    162163                return super.newInputStream(pEnsureBuffered); 
    163164        } 
     
    167168         */ 
    168169        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(); } 
    170171                return super.getTreeLastModif(); 
    171172        } 
     
    175176         */ 
    176177        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); } 
    178179                return super.getLastModif(); 
    179180        } 
     
    183184         */ 
    184185        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); } 
    186187                return super.getContentSize(); 
    187188        } 
     
    191192         */ 
    192193        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); } 
    194195                return super.getContentStatus(); 
    195196        } 
     
    199200         */ 
    200201        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); } 
    202203                return super.listChildrenNames(pListToAppend, pStatusChilds); 
    203204        } 
     
    207208         */ 
    208209        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); } 
    211212                return super.newOutputStream(pEnsureBuffered); 
    212213        } 
     
    216217         */ 
    217218        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); } 
    219220                return super.createAsFile(); 
    220221        } 
     
    224225         */ 
    225226        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); } 
    227228                return super.createAsFolder(); 
    228229        } 
     
    232233         */ 
    233234        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); } 
    235236                return super.removeSrc(); 
    236237        } 
  • trunk/Jav_Src/src/com/scenari/src/ISrcContent.java

    r17211 r19638  
    5353import com.scenari.src.helpers.util.SrcContentNull; 
    5454 
     55import eu.scenari.commons.security.ScSecurityException; 
     56 
    5557/** 
    5658 * <p>Source de contenu anonyme.</p> 
     
    8385 * <p>Si l'implémentation de cette source gère un système d'autorisation d'accès 
    8486 * 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> 
    8688 */ 
    8789public interface ISrcContent extends ISrcAspectable { 
  • trunk/Jav_Src/src/com/scenari/src/aspect/ISrcAspectable.java

    r14602 r19638  
    3939package com.scenari.src.aspect; 
    4040 
    41 import com.scenari.src.NotAllowedException; 
     41import eu.scenari.commons.security.ScSecurityException; 
    4242 
    4343/** 
     
    5151         * @param pDefinition Définition de l'aspect demandé. 
    5252         * @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. 
    5454         */ 
    5555        public <T> T getAspect(ISrcAspectDef<T> pDefinition) throws Exception; 
  • trunk/Jav_Src/src/com/scenari/src/helpers/lnk/SrcNodeLnkFrontEndRestrictRights.java

    r17211 r19638  
    4545import com.scenari.src.ISrcNode; 
    4646import com.scenari.src.ISrcServer; 
    47 import com.scenari.src.NotAllowedException; 
    4847import com.scenari.src.aspect.ISrcAspectDef; 
    4948import com.scenari.src.feature.rights.IAccessRightsAspect; 
    5049import com.scenari.src.feature.rights.SrcFeatureRights; 
     50 
     51import eu.scenari.commons.security.ScSecurityException; 
    5152 
    5253/** 
     
    7980                                return vResult; 
    8081                        } else { 
    81                                 throw new NotAllowedException(); 
     82                                throw new ScSecurityException(pDefinition.rightsToCheck()); 
    8283                        } 
    8384                } 
     
    103104         */ 
    104105        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); 
    106107                return super.listChildrenNodes(pListToAppend); 
    107108        } 
     
    111112         */ 
    112113        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); 
    114115                return super.newInputStream(pEnsureBuffered); 
    115116        } 
     
    119120         */ 
    120121        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(); 
    122123                return super.getTreeLastModif(); 
    123124        } 
     
    127128         */ 
    128129        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); 
    130131                return super.getLastModif(); 
    131132        } 
     
    135136         */ 
    136137        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); 
    138139                return super.getContentSize(); 
    139140        } 
     
    143144         */ 
    144145        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); 
    146147                return super.getContentType(); 
    147148        } 
     
    151152         */ 
    152153        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); 
    154155                return super.getContentStatus(); 
    155156        } 
     
    159160         */ 
    160161        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); 
    162163                return super.listChildrenNames(pListToAppend, pStatusChilds); 
    163164        } 
     
    167168         */ 
    168169        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(); } 
    171172                return super.newOutputStream(pEnsureBuffered); 
    172173        } 
     
    176177         */ 
    177178        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); 
    179180                return super.createAsFile(); 
    180181        } 
     
    184185         */ 
    185186        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); 
    187188                return super.createAsFolder(); 
    188189        } 
     
    192193         */ 
    193194        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); 
    195196                return super.removeSrc(); 
    196197        } 
  • trunk/Jav_Src/src/com/scenari/src/helpers/util/SrcContentRestrictRights.java

    r17211 r19638  
    4444 
    4545import com.scenari.src.ISrcContent; 
    46 import com.scenari.src.NotAllowedException; 
    4746import com.scenari.src.aspect.ISrcAspectDef; 
    4847import com.scenari.src.feature.rights.IAccessRightsAspect; 
    4948import com.scenari.src.feature.rights.SrcFeatureRights; 
     49 
     50import eu.scenari.commons.security.ScSecurityException; 
    5051 
    5152/** 
     
    7778                                return vResult; 
    7879                        } else { 
    79                                 throw new NotAllowedException(); 
     80                                throw new ScSecurityException(); 
    8081                        } 
    8182                } 
     
    106107        public String getContentType() throws Exception { 
    107108                if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getContentType(); } 
    108                 throw new NotAllowedException(); 
     109                throw new ScSecurityException(); 
    109110        } 
    110111 
     
    114115        public InputStream newInputStream(boolean pEnsureBuffered) throws Exception { 
    115116                if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.newInputStream(pEnsureBuffered); } 
    116                 throw new NotAllowedException(); 
     117                throw new ScSecurityException(); 
    117118        } 
    118119 
     
    122123        public long getLastModif() throws Exception { 
    123124                if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getLastModif(); } 
    124                 throw new NotAllowedException(); 
     125                throw new ScSecurityException(); 
    125126        } 
    126127 
     
    130131        public long getTreeLastModif() throws Exception { 
    131132                if (SrcFeatureRights.isAllowed(this, SrcFeatureRights.RIGHT_READ | SrcFeatureRights.RIGHT_LISTCHILDREN)) { return fSubSource.getTreeLastModif(); } 
    132                 throw new NotAllowedException(); 
     133                throw new ScSecurityException(); 
    133134        } 
    134135 
     
    138139        public List listChildrenNames(List pListToAppend, int pStatusChilds) throws Exception { 
    139140                if ((fRights & SrcFeatureRights.RIGHT_LISTCHILDREN) != 0) { return fSubSource.listChildrenNames(pListToAppend, pStatusChilds); } 
    140                 throw new NotAllowedException(); 
     141                throw new ScSecurityException(); 
    141142 
    142143        } 
     
    147148        public OutputStream newOutputStream(boolean pEnsureBuffered) throws Exception { 
    148149                if ((fRights & SrcFeatureRights.RIGHT_WRITE) != 0) { return fSubSource.newOutputStream(pEnsureBuffered); } 
    149                 throw new NotAllowedException(); 
     150                throw new ScSecurityException(); 
    150151        } 
    151152 
     
    162163        public long getContentSize() throws Exception { 
    163164                if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getContentSize(); } 
    164                 throw new NotAllowedException(); 
     165                throw new ScSecurityException(); 
    165166 
    166167        } 
     
    171172        public int getContentStatus() throws Exception { 
    172173                if ((fRights & SrcFeatureRights.RIGHT_READ) != 0) { return fSubSource.getContentStatus(); } 
    173                 throw new NotAllowedException(); 
     174                throw new ScSecurityException(); 
    174175        } 
    175176 
     
    179180        public boolean createAsFile() throws Exception { 
    180181                if ((fRights & SrcFeatureRights.RIGHT_CREATEFILE) != 0) { return fSubSource.createAsFile(); } 
    181                 throw new NotAllowedException(); 
     182                throw new ScSecurityException(); 
    182183        } 
    183184 
     
    187188        public boolean createAsFolder() throws Exception { 
    188189                if ((fRights & SrcFeatureRights.RIGHT_CREATEFOLDER) != 0) { return fSubSource.createAsFolder(); } 
    189                 throw new NotAllowedException(); 
     190                throw new ScSecurityException(); 
    190191        } 
    191192 
     
    197198                case ISrcContent.STATUS_FILE: 
    198199                case ISrcContent.STATUS_FOLDER: { 
    199                         if ((fRights & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new NotAllowedException(); 
     200                        if ((fRights & SrcFeatureRights.RIGHT_REMOVE) == 0) throw new ScSecurityException(); 
    200201                        return fSubSource.removeSrc(); 
    201202                } 
  • trunk/Jav_Src/src/com/scenari/src/helpers/util/SrcNodeFrontEndRestrictRights.java

    r17211 r19638  
    4646import com.scenari.src.ISrcNode; 
    4747import com.scenari.src.ISrcServer; 
    48 import com.scenari.src.NotAllowedException; 
    4948import com.scenari.src.aspect.ISrcAspectDef; 
    5049import com.scenari.src.feature.rights.IAccessRightsAspect; 
    5150import com.scenari.src.feature.rights.SrcFeatureRights; 
     51 
     52import eu.scenari.commons.security.ScSecurityException; 
    5253 
    5354/** 
     
    8384                                return vResult; 
    8485                        } else { 
    85                                 throw new NotAllowedException(); 
     86                                throw new ScSecurityException(); 
    8687                        } 
    8788                } 
     
    112113         */ 
    113114        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(); 
    115116                return super.listChildrenNodes(pListToAppend); 
    116117        } 
     
    120121         */ 
    121122        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(); 
    123124                return super.newInputStream(pEnsureBuffered); 
    124125        } 
     
    128129         */ 
    129130        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(); 
    131132                return super.getTreeLastModif(); 
    132133        } 
     
    136137         */ 
    137138        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(); 
    139140                return super.getLastModif(); 
    140141        } 
     
    144145         */ 
    145146        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(); 
    147148                return super.getContentSize(); 
    148149        } 
     
    152153         */ 
    153154        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(); 
    155156                return super.getContentType(); 
    156157        } 
     
    160161         */ 
    161162        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(); 
    163164                return super.getContentStatus(); 
    164165        } 
     
    168169         */ 
    169170        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(); 
    171172                return super.listChildrenNames(pListToAppend, pStatusChilds); 
    172173        } 
     
    176177         */ 
    177178        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(); } 
    180181                return super.newOutputStream(pEnsureBuffered); 
    181182        } 
     
    185186         */ 
    186187        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(); 
    188189                return super.createAsFile(); 
    189190        } 
     
    193194         */ 
    194195        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(); 
    196197                return super.createAsFolder(); 
    197198        } 
     
    201202         */ 
    202203        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(); 
    204205                return super.removeSrc(); 
    205206        } 
  • trunk/Jav_Src/src/com/scenari/src/helpers/util/SrcNodeRestrictRights.java

    r17139 r19638  
    4545import com.scenari.src.ISrcNode; 
    4646import com.scenari.src.ISrcServer; 
    47 import com.scenari.src.NotAllowedException; 
    4847import com.scenari.src.aspect.ISrcAspectDef; 
    4948import com.scenari.src.feature.paths.IPathResolverAspect; 
    5049import com.scenari.src.feature.paths.SrcFeaturePaths; 
    5150import com.scenari.src.feature.rights.SrcFeatureRights; 
     51 
     52import eu.scenari.commons.security.ScSecurityException; 
    5253 
    5354/** 
     
    147148                        return pListToAppend; 
    148149                } 
    149                 throw new NotAllowedException(); 
     150                throw new ScSecurityException(); 
    150151        } 
    151152 
  • trunk/Jav_Wsp/src/com/scenari/m/bdp/item/fs/WspSrcNodeRoot.java

    r19365 r19638  
    4040 
    4141import com.scenari.src.ISrcNode; 
    42 import com.scenari.src.NotAllowedException; 
    4342import com.scenari.src.aspect.ISrcAspectDef; 
    4443import com.scenari.src.feature.tasks.ISrcTask; 
    4544import com.scenari.src.feature.tasks.ISrcTaskMgr; 
    4645 
     46import eu.scenari.commons.security.ScSecurityException; 
    4747import eu.scenari.commons.util.lang.TunneledException; 
    4848 
     
    7070 
    7171        public boolean removeSrc() throws Exception { 
    72                 throw new NotAllowedException(); 
     72                throw new ScSecurityException(); 
    7373        } 
    7474 
  • trunk/Jav_Wsp/src/com/scenari/m/bdp/service/tabitemtype/SvcItemTypePermReg.java

    r19623 r19638  
    4343import eu.scenari.commons.security.PermissionMgr; 
    4444 
    45 public interface SvcItemTypePermReg { 
     45public abstract class SvcItemTypePermReg { 
    4646 
    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); 
    4848 
    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); 
    5050} 
  • trunk/Jav_WspOdb/src/eu/scenari/wspodb/wsp/src/OdbReadOnlySrcNode.java

    r17761 r19638  
    4444 
    4545import com.scenari.src.ISrcNode; 
    46 import com.scenari.src.NotAllowedException; 
    4746import com.scenari.src.aspect.ISrcAspectDef; 
    4847import com.scenari.src.feature.copymove.SrcFeatureCopyMove.IIfTargetExistBehavior; 
     
    5049import com.scenari.src.feature.rights.SrcFeatureRights; 
    5150 
     51import eu.scenari.commons.security.ScSecurityException; 
    5252import eu.scenari.wspodb.wsp.OdbWspDefinition; 
    5353 
     
    7272 
    7373        public void copyFrom(ISrcNode pFrom, IIfTargetExistBehavior pIfTargetExist, Object... pOptions) throws Exception { 
    74                 throw new NotAllowedException(); 
     74                throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 
    7575        } 
    7676 
    7777        public void moveFrom(ISrcNode pFrom, IIfTargetExistBehavior pIfTargetExist, Object... pOptions) throws Exception { 
    78                 throw new NotAllowedException(); 
     78                throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 
    7979        } 
    8080 
    8181        public boolean createAsFile() throws Exception { 
    82                 throw new NotAllowedException(); 
     82                throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFILE); 
    8383        } 
    8484 
    8585        public boolean createAsFolder() throws Exception { 
    86                 throw new NotAllowedException(); 
     86                throw new ScSecurityException(SrcFeatureRights.RIGHT_CREATEFOLDER); 
    8787        } 
    8888 
    8989        public OutputStream newOutputStream(boolean pEnsureBuffered) throws Exception { 
    90                 throw new NotAllowedException(); 
     90                throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 
    9191        } 
    9292 
    9393        public boolean removeSrc() throws Exception { 
    9494                //XXX Utiliser pour suppression définitive (history, trash, snapshot...) ? 
    95                 throw new NotAllowedException(); 
     95                throw new ScSecurityException(SrcFeatureRights.RIGHT_WRITE); 
    9696        } 
    9797 
Note: See TracChangeset for help on using the changeset viewer.