[Zope-CMF] Re: DCWorkflow small glitch

Dorneles Treméa dorneles at x3ng.com.br
Mon Jul 19 12:05:13 EDT 2004


Hello,

> When you use 'Role1; Role2; Role3' as a guard, it displays
> 'Requires role: Role1 ; Role2 or Role3' instead of 2 'or's...
> 
> The question is: why check for self.permissions/self.roles lenght
> instead of always add 'or's?

the previous excerpt was from CMF-1_4-branch... I just checked
and seems that Shane changed[1] that code on HEAD, but keeps the
old behavior:

def formatNameUnion(names):
     escaped = ['<code>' + escape(name) + '</code>' for name in names]
     if len(escaped) == 2:
         return ' or '.join(escaped)
     elif len(escaped) > 2:
         escaped[-1] = ' or ' + escaped[-1]
     return '; '.join(escaped)

I'm curious about it... Shane, could you enlight us? :-)

[1] http://cvs.zope.org/CMF/DCWorkflow/Guard.py.diff?r1=1.7&r2=1.8

Cheers,

-- 

Dorneles Treméa
Caxias do Sul - RS - Brasil
+55 54 9114 9312 - UIN: 2413568
X3ng Web Technology <http://www.x3ng.com.br>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/IT d- s:->: a25 C+++ UBL++++$ P--- L++ E-- W+++
N++ o? K? w+ O M+ V-- PS+ PE- Y-- PGP++ t+ 5 X++ R+
tv+ b(++) DI+ D++ G+>+++ e++>++++ h---- r+++ y+++**
------END GEEK CODE BLOCK------



More information about the Zope-CMF mailing list