[gen] added obj.mayEdit, an additional condition for editing an object (similar to mayDelete); bugfix: specifying a workflow for a User class crashed because, in installer.py, Appy took into account the standard workflow on this Class instead of the custom one.

This commit is contained in:
Gaetan Delannay 2012-06-01 15:57:19 +02:00
parent e3b7f5364f
commit 0d7afb685f
9 changed files with 49 additions and 25 deletions

View file

@ -40,7 +40,7 @@
</tal:moveRef>
</td>
<tal:comment replace="nothing">Edit the element</tal:comment>
<td tal:condition="python: obj.allows('Modify portal content') and not appyType['noForm']">
<td tal:condition="python: not appyType['noForm'] and obj.mayEdit()">
<a tal:define="navInfo python:'ref.%s.%s:%s.%d.%d' % (contextObj.UID(), fieldName, appyType['pageName'], repeat['obj'].number()+startNumber, totalNumber);"
tal:attributes="href python: obj.getUrl(mode='edit', page='main', nav=navInfo)">
<img title="Edit" tal:attributes="src string: $appUrl/ui/edit.gif"/>
@ -48,7 +48,7 @@
</td>
<tal:comment replace="nothing">Delete the element</tal:comment>
<td>
<img tal:condition="python: not appyType['isBack'] and obj.allows('Delete objects') and obj.mayDelete()"
<img tal:condition="python: not appyType['isBack'] and obj.mayDelete()"
title="Delete" style="cursor:pointer"
tal:attributes="src string: $appUrl/ui/delete.png;
onClick python:'onDeleteObject(\'%s\')' % obj.UID()"/>