bug 2913 : Sort of fixed. At least, I've fixed the wrong bit - the button on the form is now no longer there, but the link still reads 'edit'. However, this is a whole lot better.

This commit is contained in:
sb 2009-05-06 18:02:35 +00:00
parent 97e9b62ace
commit 2bd5c55412
2 changed files with 54 additions and 10 deletions

View file

@ -15,8 +15,8 @@
Transform ADL into velocity view templates
$Author: sb $
$Revision: 1.55 $
$Date: 2009-05-06 17:25:55 $
$Revision: 1.56 $
$Date: 2009-05-06 18:02:35 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
Whitespace (or lack of it) is significant! -->
@ -442,12 +442,30 @@
<xsl:with-param name="entity" select="$form/ancestor::adl:entity"/>
</xsl:call-template>
</xsl:variable>
<!-- NOTE! NOTE! NOTE! Whitespace is significant - any linefeeds inside the #if ( ) clause
<xsl:variable name="updategroups">
<xsl:call-template name="entity-update-groups">
<xsl:with-param name="entity" select="$form/ancestor::adl:entity"/>
</xsl:call-template>
</xsl:variable>
<!-- NOTE! NOTE! NOTE! Whitespace is significant - any linefeeds inside the #if ( ) clause
cause the Velocity parser to break! -->
#if ( <xsl:for-each select="exsl:node-set( $savegroups)/*"> ${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} ||</xsl:for-each> false)
<xsl:call-template name="save-widget-row"/>
#end
<xsl:variable name="deletegroups">
#if ( $instance)
#if ( $instance.IsNew)
#if ( <xsl:for-each select="exsl:node-set( $savegroups)/*"> ${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} ||</xsl:for-each> false)
<xsl:call-template name="save-widget-row"/>
#end
#else
#if ( <xsl:for-each select="exsl:node-set( $updategroups)/*"> ${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} || </xsl:for-each> false)
<xsl:call-template name="save-widget-row"/>
#end
#end
#else
<!-- for application-layer authentication, we may not actually have an instance at this stage -->
#if ( <xsl:for-each select="exsl:node-set( $savegroups)/*"> ${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} || </xsl:for-each> false)
<xsl:call-template name="save-widget-row"/>
#end
#end
<xsl:variable name="deletegroups">
<xsl:call-template name="entity-delete-groups">
<xsl:with-param name="entity" select="$form/ancestor::adl:entity"/>
</xsl:call-template>
@ -1789,7 +1807,7 @@
Auto generated Velocity macro for <xsl:value-of select="@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.55 $', 10)"/>
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.56 $', 10)"/>
Generation parameters were:
area-name: <xsl:value-of select="$area-name"/>
default-url: <xsl:value-of select="$default-url"/>

View file

@ -15,8 +15,8 @@
Utility templates to find permissions on various things
$Author: sb $
$Revision: 1.4 $
$Date: 2009-04-30 08:56:33 $
$Revision: 1.5 $
$Date: 2009-05-06 18:02:35 $
-->
<!-- collect all groups which can edit the specified property -->
@ -166,6 +166,32 @@
</xsl:for-each>
</xsl:template>
<!-- collect the groups which can save an entity -->
<xsl:template name="entity-update-groups">
<xsl:param name="entity"/>
<xsl:for-each select="//adl:group">
<xsl:variable name="groupname" select="@name"/>
<xsl:variable name="perm">
<xsl:choose>
<xsl:when test="$entity/adl:permission[@group=$groupname]">
<xsl:value-of select="$entity/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:otherwise>none</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$perm='all'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:when test="$perm='edit'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- collect the groups which can delete an entity -->
<xsl:template name="entity-delete-groups">
<xsl:param name="entity"/>