[Zope-CMF] Re: DCWorkflow small glitch
Tres Seaver
tseaver at zope.com
Mon Jul 19 10:40:32 EDT 2004
Dorneles Treméa wrote:
> Hey guys,
>
> I was playing a bit deeper with DCWorkflow and found a slighting
> discrepance on getSummary method (used to display a formated text
> on 'Transtions' tab inside ZMI) from Guard class on Guard module:
>
> for idx in range(len(self.permissions)):
> p = self.permissions[idx]
> if idx > 0:
> if idx < len(self.permissions) - 1:
> res.append(';')
> else:
> res.append('or')
> res.append('<code>' + escape(p) + '</code>')
> ...
> for idx in range(len(self.roles)):
> r = self.roles[idx]
> if idx > 0:
> if idx < len(self.roles) - 1:
> res.append(';')
> else:
> res.append('or')
> res.append('<code>' + escape(r) + '</code>')
>
> 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?
>
> Am I missing something or can I commit a small fix?
+1 on the fix.
Tres.
--
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
More information about the Zope-CMF
mailing list