<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Verdana size=2>Ce serait une autre façon de faire effectivement,
mais je rencontre le même problème avec les permissions spécifiques CPS, pas de
déclarations de sécurité dessus.</FONT></DIV>
<DIV><FONT face=Verdana size=2>Où serait le mal à définir ces constantes en
publiques ?</FONT></DIV>
<DIV><FONT face=Verdana size=2>CMF le fait dans son framework, pourquoi pas CPS
?</FONT></DIV>
<DIV><FONT face=Verdana size=2>Y a-t-il des raisons techniques à ce choix
?</FONT></DIV>
<DIV>
<HR>
<FONT style="FONT-SIZE: 9px; COLOR: #00adce; FONT-FAMILY: Verdana"><FONT
style="FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #0c4da2">Cédric
Marfil</FONT><BR>Concepteur Réalisateur Intégrateur Confirmé<BR><B>Tél.
direct:</B> 03.20.65.34.82<BR><B>Mail:</B> <A
href="mailto:cedric.marfil@capgemini.com">cedric.marfil@capgemini.com</A><BR><BR><FONT
style="FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #0c4da2">Cap</FONT><FONT
style="FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #00adce">gemini</FONT><BR>181
rue Jules Delcenserie<BR>59700 Marcq en Baroeul<BR></FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=at@nuxeo.com href="mailto:at@nuxeo.com">Anahide Tchertchian</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=cmarfil@capgemini.fr
href="mailto:cmarfil@capgemini.fr">Cedric Marfil</A> ; <A
title=cps-users-fr@lists.nuxeo.com
href="mailto:cps-users-fr@lists.nuxeo.com">Liste Nuxéo</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, September 26, 2006 11:47
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [CPS-users-fr]
CPSWorkflow.constants</DIV>
<DIV><BR></DIV>Cedric Marfil a écrit :<BR>> Bonjour,<BR>> Ayant le
besoin de créer des workflows spécifiques, je me suis intéressé <BR>> à la
méthode 'verifyWorkflow' de l'installer.<BR>> J'ai donc construit un skin
qui me retourne les workflows à installer, <BR>> mais pour pouvoir définir
ces derniers, j'avais besoin d'accéder aux <BR>> constantes stockées dans
CPSWorkflow/constants.py.<BR>> Quoi que je fasse, je n'avais jamais accès à
ces constantes. Je me suis <BR>> donc inspiré de ce qui était fait dans
CPSCore/permissions.py puisque <BR>> l'import de constantes de permissions
fonctionnait.<BR>> J'ai donc ajouté au fichier constants.py le code
suivant:<BR>> <BR>> from AccessControl import
ModuleSecurityInfo<BR>> security =
ModuleSecurityInfo('Products.CPSWorkflow.constants')<BR>> <BR>>
security.declarePublic('TRANSITION_ALLOWSUB_CREATE')<BR>>
TRANSITION_ALLOWSUB_CREATE = 10<BR>>
security.declarePublic('TRANSITION_ALLOWSUB_DELETE')<BR>>
TRANSITION_ALLOWSUB_DELETE = 11<BR>>
security.declarePublic('TRANSITION_ALLOWSUB_MOVE')<BR>>
TRANSITION_ALLOWSUB_MOVE = 12 # Into this container.<BR>>
security.declarePublic('TRANSITION_ALLOWSUB_COPY')<BR>>
TRANSITION_ALLOWSUB_COPY = 13 # Same...<BR>> .<BR>> .<BR>> ..<BR>>
Pour chaque constante déclarée, j'ai ajouté une déclaration de sécurité.
<BR>> Maintenant, mon code fonctionne.<BR>> <BR>> Est-ce la
bonne solution ?<BR>> Si oui, peut-on intégrer cette modification à CPS
?<BR>> Si non, quelle est la bonne solution ?<BR><BR>Bonjour,<BR><BR>Ca
n'est pas vraiment la bonne solution : ces valeurs sont protégées, <BR>non
disponibles en code restreint (scripts de skin) et n'ont pas <BR>réellement
besoin d'être mises a sa disposition<BR><BR>La bonne méthode consiste à placer
le code qui décrit les workflows à <BR>mettre en place en code restreint,
comme c'est le cas dans l'ancienne <BR>méthode
CPSDefault/Extensions/cpsinstall.py.<BR><BR>La meilleure méthode consiste à
utiliser la configuration xml et <BR>GenericSetup mais cette option n'est
peut-être pas disponible pour la <BR>version que vous utilisez
(?).<BR><BR>Cordialement,<BR><BR>-- <BR>Anahide Tchertchian, Nuxeo<BR>Mail: <A
href="mailto:at@nuxeo.com">at@nuxeo.com</A> - Tel: +33 (0)1 40 33 71 60<BR><A
href="http://www.nuxeo.com">http://www.nuxeo.com</A> - <A
href="http://www.cps-project.org">http://www.cps-project.org</A><BR>_______________________________________________<BR>cps-users-fr
<BR>Adresse de la liste : <A
href="mailto:cps-users-fr@lists.nuxeo.com">cps-users-fr@lists.nuxeo.com</A><BR>Gestion
de l'abonnement : <<A
href="http://lists.nuxeo.com/mailman/listinfo/cps-users-fr">http://lists.nuxeo.com/mailman/listinfo/cps-users-fr</A>></BLOCKQUOTE></BODY></HTML>
<table><tr><td bgcolor=#ffffff><font color=#000000>This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.<br>
<br>
</font></td></tr></table>