bug 2847 : Right, the session timeout behaviour is now as follows; in ADL, all pages now timeout after $page-timeout seconds (default is 300) to $default-page (default id default.aspx) unless $page-timeout is set to zero. This behaviour is overridden in SRU Hospitality to redirect to dblogin/dologout.rails, thus guaranteeing both the database and forms authentication settings are also cleared.

status 2847: resolved FIXED
This commit is contained in:
sb 2009-04-30 08:56:33 +00:00
parent c1e9c49647
commit e83ba2c9ac
2 changed files with 263 additions and 135 deletions

View file

@ -15,8 +15,8 @@
Transform ADL into velocity view templates Transform ADL into velocity view templates
$Author: sb $ $Author: sb $
$Revision: 1.39 $ $Revision: 1.40 $
$Date: 2009-04-28 13:44:51 $ $Date: 2009-04-30 08:56:33 $
--> -->
<!-- WARNING WARNING WARNING: Do NOT reformat this file! <!-- WARNING WARNING WARNING: Do NOT reformat this file!
Whitespace (or lack of it) is significant! --> Whitespace (or lack of it) is significant! -->
@ -67,6 +67,11 @@
If not 'Application', then 'Database'. --> If not 'Application', then 'Database'. -->
<xsl:param name="authentication-layer" select="'Application'"/> <xsl:param name="authentication-layer" select="'Application'"/>
<!-- bug 2847: how long to wait on a page before it auto-redirects to the default URL -->
<xsl:param name="page-timeout" select="300"/>
<!-- bug 2847: the default URL, probably a 'please login' screen -->
<xsl:param name="default-url" select="'../default.aspx'"/>
<xsl:template match="adl:application"> <xsl:template match="adl:application">
<output> <output>
<!-- 'output' is a dummy wrapper root tag to make the entire output work as <!-- 'output' is a dummy wrapper root tag to make the entire output work as
@ -118,14 +123,12 @@
<xsl:call-template name="i18n-really-delete"/> <xsl:call-template name="i18n-really-delete"/>
</xsl:variable> </xsl:variable>
#set( $title = "<xsl:value-of select="concat( $really-delete, ' ', @name)"/> $instance.UserIdentifier") #set( $title = "<xsl:value-of select="concat( $really-delete, ' ', @name)"/> $instance.UserIdentifier")
<xsl:comment> #capturefor( headextras)
<xsl:value-of select="$product-version"/> <xsl:comment>
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>, Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.39 $', 10)"/>
</xsl:comment> </xsl:comment>
<xsl:call-template name="head"/>
#end
<xsl:call-template name="maybe-delete"> <xsl:call-template name="maybe-delete">
<xsl:with-param name="entity" select="."/> <xsl:with-param name="entity" select="."/>
</xsl:call-template> </xsl:call-template>
@ -156,15 +159,10 @@
</xsl:variable> </xsl:variable>
#set( $title = "<xsl:value-of select="concat( $really-delete, ' ', @name)"/> $instance.UserIdentifier") #set( $title = "<xsl:value-of select="concat( $really-delete, ' ', @name)"/> $instance.UserIdentifier")
<head> <head>
<xsl:call-template name="head"/> <xsl:comment>
<xsl:comment> Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>, </xsl:comment>
generated from ADL. <xsl:call-template name="head"/>
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.39 $', 10)"/>
<xsl:value-of select="/adl:application/@revision"/>
</xsl:comment>
<xsl:call-template name="install-scripts"/> <xsl:call-template name="install-scripts"/>
</head> </head>
<body> <body>
@ -237,26 +235,7 @@
</xsl:text> </xsl:text>
<xsl:comment>[ cut here: next file '<xsl:value-of select="concat( ancestor::adl:entity/@name, '/', @name)"/>.auto.vm' ]</xsl:comment> <xsl:comment>[ cut here: next file '<xsl:value-of select="concat( ancestor::adl:entity/@name, '/', @name)"/>.auto.vm' ]</xsl:comment>
<xsl:text> <xsl:text>
</xsl:text> </xsl:text>
<xsl:comment>
<xsl:value-of select="$product-version"/>
Auto generated Velocity <xsl:value-of select="@name"/> form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.39 $', 10)"/>
Generation parameters were:
locale: <xsl:value-of select="$locale"/>
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
show-errors: <xsl:value-of select="$show-errors"/>
show-messages: <xsl:value-of select="$show-messages"/>
max-widget-width: <xsl:value-of select="$max-widget-width"/>
product-version: <xsl:value-of select="$product-version"/>
layout-name: <xsl:value-of select="$layout-name"/>
area-name: <xsl:value-of select="$area-name"/>
<xsl:value-of select="/adl:application/@revision"/>
</xsl:comment>
#capturefor( title) #capturefor( title)
#if ( $instance) #if ( $instance)
#if ( ! $instance.IsNew) #if ( ! $instance.IsNew)
@ -273,6 +252,9 @@
#end #end
#end #end
#capturefor( headextras) #capturefor( headextras)
<xsl:comment>
Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
</xsl:comment>
<xsl:call-template name="head"/> <xsl:call-template name="head"/>
<xsl:call-template name="generate-head-javascript"> <xsl:call-template name="generate-head-javascript">
<xsl:with-param name="form" select="."/> <xsl:with-param name="form" select="."/>
@ -325,26 +307,18 @@
#end #end
</xsl:comment> </xsl:comment>
<head> <head>
<xsl:call-template name="head"/> <xsl:comment>
<xsl:comment> Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
<xsl:value-of select="$product-version"/> </xsl:comment>
<xsl:call-template name="head"/>
Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>, <xsl:if test="$page-timeout &gt; 0">
generated from ADL. <meta http-equiv="refresh" content="5; URL=http://www.cryer.co.uk">
<xsl:attribute name="content">
Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.39 $', 10)"/> <xsl:value-of select="concat($page-timeout, '; URL=', $default-url)"/>
Generation parameters were: </xsl:attribute>
locale: <xsl:value-of select="$locale"/> </meta>
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/> </xsl:if>
show-errors: <xsl:value-of select="$show-errors"/> <xsl:call-template name="install-scripts"/>
show-messages: <xsl:value-of select="$show-messages"/>
max-widget-width: <xsl:value-of select="$max-widget-width"/>
product-version: <xsl:value-of select="$product-version"/>
layout-name: <xsl:value-of select="$layout-name"/>
area-name: <xsl:value-of select="$area-name"/>
<xsl:value-of select="/adl:application/@revision"/>
</xsl:comment>
<xsl:call-template name="install-scripts"/>
<xsl:call-template name="generate-head-javascript"> <xsl:call-template name="generate-head-javascript">
<xsl:with-param name="form" select="."/> <xsl:with-param name="form" select="."/>
</xsl:call-template> </xsl:call-template>
@ -525,7 +499,19 @@
</xsl:template> </xsl:template>
<xsl:template match="adl:fieldgroup"> <xsl:template match="adl:fieldgroup">
<div class="tab-pane"> <xsl:if test="$authentication-layer = 'Database'">
<xsl:variable name="property" select="."/>
<xsl:variable name="readgroups">
<xsl:call-template name="fieldgroup-read-groups">
<xsl:with-param name="fieldgroup" select="."/>
</xsl:call-template>
</xsl:variable>
<!-- NOTE! NOTE! NOTE! Whitespace is significant - any linefeeds inside the #if ( ) clause cause the Velocity parser to break! -->
<xsl:comment>If the user can't read the fieldgroup, don't output it at all.</xsl:comment>
#if ( <xsl:for-each select="exsl:node-set( $readgroups)/*"> ${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} ||</xsl:for-each> false)
</xsl:if>
<div class="tab-pane">
<xsl:attribute name="id"> <xsl:attribute name="id">
<xsl:value-of select="concat( @name, 'pane')"/> <xsl:value-of select="concat( @name, 'pane')"/>
</xsl:attribute> </xsl:attribute>
@ -547,6 +533,9 @@
<xsl:apply-templates select="adl:field|adl:verb|adl:auxlist"/> <xsl:apply-templates select="adl:field|adl:verb|adl:auxlist"/>
</table> </table>
</div> </div>
<xsl:if test="$authentication-layer = 'Database'">
#end
</xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="adl:auxlist"> <xsl:template match="adl:auxlist">
@ -623,7 +612,15 @@
</xsl:template> </xsl:template>
<xsl:template match="adl:verb"> <xsl:template match="adl:verb">
<xsl:variable name="class"> <xsl:variable name="executegroups">
<xsl:call-template name="verb-execute-groups">
<xsl:with-param name="verb" select="."/>
</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( $executegroups)/*"> ${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} ||</xsl:for-each> false)
<xsl:variable name="class">
<xsl:choose> <xsl:choose>
<xsl:when test="@dangerous='true'">actionDangerous</xsl:when> <xsl:when test="@dangerous='true'">actionDangerous</xsl:when>
<xsl:otherwise>actionSafe</xsl:otherwise> <xsl:otherwise>actionSafe</xsl:otherwise>
@ -658,8 +655,9 @@
</td> </td>
</tr> </tr>
#end #end
#end #end
</xsl:template> #end
</xsl:template>
<xsl:template match="adl:field"> <xsl:template match="adl:field">
<xsl:variable name="propname"> <xsl:variable name="propname">
@ -726,7 +724,17 @@
it may be we need to add a mode to indicate this! --> it may be we need to add a mode to indicate this! -->
<!-- for links and lists we implement a shuffle widget, which extends over both columns --> <!-- for links and lists we implement a shuffle widget, which extends over both columns -->
<xsl:param name="oddness" select="odd"/> <xsl:param name="oddness" select="odd"/>
<tr> <xsl:if test="$authentication-layer = 'Database'">
<xsl:variable name="property" select="."/>
<xsl:variable name="readgroups">
<xsl:call-template name="entity-read-groups">
<xsl:with-param name="entity" select="//adl:entity[@name=$property/@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( $readgroups)/*">${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} || </xsl:for-each> false)
</xsl:if>
<tr>
<xsl:attribute name="class"> <xsl:attribute name="class">
<xsl:value-of select="$oddness"/> <xsl:value-of select="$oddness"/>
</xsl:attribute> </xsl:attribute>
@ -736,33 +744,12 @@
<xsl:with-param name="fallback" select="@name"/> <xsl:with-param name="fallback" select="@name"/>
</xsl:call-template>")} </xsl:call-template>")}
</td> </td>
<td class="widget shuffle" colspan="2"> <td class="widget shuffle" colspan="2">
<xsl:choose> <xsl:call-template name="shuffle-widget">
<xsl:when test="$authentication-layer = 'Database'"> <xsl:with-param name="property" select="."/>
<xsl:variable name="property" select="."/> </xsl:call-template>
<xsl:variable name="readgroups"> </td>
<xsl:call-template name="entity-read-groups"> </tr>
<xsl:with-param name="entity" select="//adl:entity[@name=$property/@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( $readgroups)/*">${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} ||</xsl:for-each> false)
<xsl:call-template name="shuffle-widget">
<xsl:with-param name="property" select="."/>
</xsl:call-template>
#else
[Not authorised]
#end
</xsl:when>
<xsl:when test="$authentication-layer = 'Application'">
<xsl:call-template name="shuffle-widget">
<xsl:with-param name="property" select="."/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</td>
</tr>
<tr> <tr>
<xsl:attribute name="class"> <xsl:attribute name="class">
<xsl:choose> <xsl:choose>
@ -774,6 +761,9 @@
<xsl:apply-templates select="adl:help[@locale = $locale]"/> <xsl:apply-templates select="adl:help[@locale = $locale]"/>
</td> </td>
</tr> </tr>
<xsl:if test="$authentication-layer = 'Database'">
#end
</xsl:if>
</xsl:template> </xsl:template>
<xsl:template name="shuffle-widget"> <xsl:template name="shuffle-widget">
@ -844,7 +834,19 @@
<xsl:with-param name="property" select="$property"/> <xsl:with-param name="property" select="$property"/>
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<tr> <xsl:if test="$authentication-layer = 'Database'">
<xsl:choose>
<xsl:when test="exsl:node-set( $readgroups)/*">
<xsl:comment>if the user can't even read the field, don't output it at all.</xsl:comment>
#if ( <xsl:for-each select="exsl:node-set( $readgroups)/*">${SecurityHelper.InGroup( "<xsl:value-of select="./@name"/>")} || </xsl:for-each> false)
</xsl:when>
<xsl:otherwise>
<xsl:comment>we haven't found any group of users who are entitled to see this field.</xsl:comment>
#if ( false)
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<tr>
<xsl:attribute name="class"> <xsl:attribute name="class">
<xsl:value-of select="$oddness"/> <xsl:value-of select="$oddness"/>
</xsl:attribute> </xsl:attribute>
@ -915,7 +917,11 @@
<xsl:apply-templates select="adl:help[@locale = $locale]"/> <xsl:apply-templates select="adl:help[@locale = $locale]"/>
</td> </td>
</tr> </tr>
</xsl:template> <xsl:if test="$authentication-layer = 'Database'">
#end
</xsl:if>
</xsl:template>
<!-- layout of lists --> <!-- layout of lists -->
@ -931,29 +937,15 @@
<xsl:with-param name="noun" select="ancestor::adl:entity/@name"/> <xsl:with-param name="noun" select="ancestor::adl:entity/@name"/>
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:comment>
<xsl:value-of select="$product-version"/>
Auto generated Velocity list for <xsl:value-of select="@name"/>, #capturefor( title)
generated from ADL. <xsl:value-of select="normalize-space( concat( 'List ', $withpluralsuffix))"/>
#end
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.39 $', 10)"/> #capturefor( headextras)
Generation parameters were: <xsl:comment>
locale: <xsl:value-of select="$locale"/> Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>,
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/> </xsl:comment>
show-errors: <xsl:value-of select="$show-errors"/> <xsl:call-template name="head"/>
show-messages: <xsl:value-of select="$show-messages"/>
max-widget-width: <xsl:value-of select="$max-widget-width"/>
product-version: <xsl:value-of select="$product-version"/>
layout-name: <xsl:value-of select="$layout-name"/>
area-name: <xsl:value-of select="$area-name"/>
</xsl:comment>
#capturefor( title)
<xsl:value-of select="normalize-space( concat( 'List ', $withpluralsuffix))"/>
#end
#capturefor( headextras)
<xsl:call-template name="head"/>
#end #end
<xsl:call-template name="top"/> <xsl:call-template name="top"/>
<xsl:call-template name="list"> <xsl:call-template name="list">
@ -994,23 +986,10 @@
<html> <html>
<head> <head>
#set( $title = "<xsl:value-of select="normalize-space( concat( 'List ', $withpluralsuffix))"/>") #set( $title = "<xsl:value-of select="normalize-space( concat( 'List ', $withpluralsuffix))"/>")
<xsl:call-template name="head"/> <xsl:comment>
<xsl:comment> Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>,
<xsl:value-of select="$product-version"/> </xsl:comment>
Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>, <xsl:call-template name="head"/>
generated from ADL.
Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.39 $', 10)"/>
Generation parameters were:
locale: <xsl:value-of select="$locale"/>
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
show-errors: <xsl:value-of select="$show-errors"/>
show-messages: <xsl:value-of select="$show-messages"/>
max-widget-width: <xsl:value-of select="$max-widget-width"/>
product-version: <xsl:value-of select="$product-version"/>
layout-name: <xsl:value-of select="$layout-name"/>
area-name: <xsl:value-of select="$area-name"/>
</xsl:comment>
<xsl:call-template name="install-scripts"/> <xsl:call-template name="install-scripts"/>
</head> </head>
<body> <body>
@ -1776,7 +1755,33 @@
${ScriptsHelper.InstallScript( "Panes")} ${ScriptsHelper.InstallScript( "Panes")}
</xsl:template> </xsl:template>
<!-- standard header material - auto-timeout, etc -->
<xsl:template name="head"> <xsl:template name="head">
<xsl:comment>
<xsl:value-of select="/adl:application/@name"/> <xsl:value-of select="$product-version"/> - <xsl:value-of select="/adl:application/@revision"/>
Auto generated Velocity macro for <xsl:value-of select="@name"/>,
generated from ADL.
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.40 $', 10)"/>
Generation parameters were:
area-name: <xsl:value-of select="$area-name"/>
default-url: <xsl:value-of select="$default-url"/>
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
layout-name: <xsl:value-of select="$layout-name"/>
locale: <xsl:value-of select="$locale"/>
max-widget-width: <xsl:value-of select="$max-widget-width"/>
product-version: <xsl:value-of select="$product-version"/>
page-timeout: <xsl:value-of select="$page-timeout"/>
show-errors: <xsl:value-of select="$show-errors"/>
show-messages: <xsl:value-of select="$show-messages"/>
</xsl:comment>
<xsl:if test="$page-timeout &gt; 0">
<meta http-equiv="refresh">
<xsl:attribute name="content">
<xsl:value-of select="concat($page-timeout, '; URL=', $default-url)"/>
</xsl:attribute>
</meta>
</xsl:if>
<xsl:choose> <xsl:choose>
<xsl:when test="adl:head"> <xsl:when test="adl:head">
<xsl:for-each select="adl:head/*"> <xsl:for-each select="adl:head/*">
@ -1791,6 +1796,7 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- standard top area content on all pages (navigation, etc) -->
<xsl:template name="top"> <xsl:template name="top">
<xsl:choose> <xsl:choose>
<xsl:when test="adl:top"> <xsl:when test="adl:top">
@ -1848,6 +1854,7 @@
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<!-- standard footer on all pages; product identifier and version -->
<xsl:template name="foot"> <xsl:template name="foot">
<xsl:choose> <xsl:choose>
<xsl:when test="adl:foot"> <xsl:when test="adl:foot">

View file

@ -15,8 +15,8 @@
Utility templates to find permissions on various things Utility templates to find permissions on various things
$Author: sb $ $Author: sb $
$Revision: 1.3 $ $Revision: 1.4 $
$Date: 2009-04-28 13:53:17 $ $Date: 2009-04-30 08:56:33 $
--> -->
<!-- collect all groups which can edit the specified property --> <!-- collect all groups which can edit the specified property -->
@ -220,7 +220,61 @@
</xsl:for-each> </xsl:for-each>
</xsl:template> </xsl:template>
<!-- find, as a string, the permission which applies to this property in the context of the named group. <!-- collect the groups which can read a fieldgroup -->
<xsl:template name="fieldgroup-read-groups">
<xsl:param name="fieldgroup"/>
<xsl:for-each select="//adl:group">
<xsl:variable name="perm">
<xsl:call-template name="fieldgroup-permission">
<xsl:with-param name="fieldgroup" select="$fieldgroup"/>
<xsl:with-param name="groupname" select="@name"/>
</xsl:call-template>
</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:when test="$perm='insert'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:when test="$perm='noedit'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:when test="$perm='read'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- collect the groups which can execute a verb -->
<xsl:template name="verb-execute-groups">
<xsl:param name="verb"/>
<xsl:for-each select="//adl:group">
<xsl:variable name="perm">
<xsl:call-template name="verb-permission">
<xsl:with-param name="verb" select="$verb"/>
<xsl:with-param name="groupname" select="@name"/>
</xsl:call-template>
</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>
<!-- find, as a string, the permission which applies to this page in the context of the named group.
NOTE: recurses up the group hierarchy - if it has cycles that's your problem, buster. NOTE: recurses up the group hierarchy - if it has cycles that's your problem, buster.
page: a page, list or form element page: a page, list or form element
groupname: a string, being the name of a group groupname: a string, being the name of a group
@ -245,7 +299,37 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- find, as a string, the permission which applies to this property in the context of the named group.
<!-- find, as a string, the permission which applies to this fieldgroup in the context of the named group.
NOTE: recurses up the group hierarchy - if it has cycles that's your problem, buster.
page: a page, list or form element
groupname: a string, being the name of a group
-->
<xsl:template name="fieldgroup-permission">
<xsl:param name="fieldgroup"/>
<xsl:param name="groupname" select="'public'"/>
<xsl:choose>
<xsl:when test="$fieldgroup/adl:permission[@group=$groupname]">
<xsl:value-of select="$fieldgroup/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:when test="$fieldgroup/ancestor::adl:page/adl:permission[@group=$groupname]">
<xsl:value-of select="$fieldgroup/ancestor::adl:page/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:when test="$fieldgroup/ancestor::adl:entity/adl:permission[@group=$groupname]">
<xsl:value-of select="$fieldgroup/ancestor::adl:entity/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:when test="//adl:group[@name=$groupname]/@parent">
<xsl:call-template name="fieldgroup-permission">
<xsl:with-param name="fieldgroup" select="$fieldgroup"/>
<xsl:with-param name="groupname" select="//adl:group[@name=$groupname]/@parent"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>none</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- find, as a string, the permission which applies to this property in the context of the named group.
NOTE: recurses up the group hierarchy - if it has cycles that's your problem, buster. NOTE: recurses up the group hierarchy - if it has cycles that's your problem, buster.
property: a property element property: a property element
groupname: a string, being the name of a group groupname: a string, being the name of a group
@ -270,7 +354,38 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- find, as a string, the permission which applies to this field in the context of the named group <!-- find, as a string, the permission which applies to this property in the context of the named group.
NOTE: recurses up the group hierarchy - if it has cycles that's your problem, buster.
NOTE: this is practically identical to property-permission - to the extent it might be
possible/desirable to combine the two.
verb: a verb element
groupname: a string, being the name of a group
-->
<xsl:template name="verb-permission">
<xsl:param name="verb"/>
<xsl:param name="groupname" select="'public'"/>
<xsl:choose>
<xsl:when test="$verb/adl:permission[@group=$groupname]">
<xsl:value-of select="$verb/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:when test="$verb/ancestor::adl:form/adl:permission[@group=$groupname]">
<xsl:value-of select="$verb/ancestor::adl:form/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:when test="$verb/ancestor::adl:entity/adl:permission[@group=$groupname]">
<xsl:value-of select="$verb/ancestor::adl:entity/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:when test="//adl:group[@name=$groupname]/@parent">
<xsl:call-template name="verb-permission">
<xsl:with-param name="verb" select="$verb"/>
<xsl:with-param name="groupname" select="//adl:group[@name=$groupname]/@parent"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>none</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- find, as a string, the permission which applies to this field in the context of the named group
field: a field element field: a field element
groupname: a string, being the name of a group groupname: a string, being the name of a group
--> -->
@ -281,6 +396,12 @@
<xsl:when test="$field/adl:permission[@group=$groupname]"> <xsl:when test="$field/adl:permission[@group=$groupname]">
<xsl:value-of select="$field/adl:permission[@group=$groupname]/@permission"/> <xsl:value-of select="$field/adl:permission[@group=$groupname]/@permission"/>
</xsl:when> </xsl:when>
<xsl:when test="$field/ancestor::adl:fieldgroup/adl:permission[@group=$groupname]">
<xsl:value-of select="$field/ancestor::adl:fieldgroup/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:when test="$field/ancestor::adl:form/adl:permission[@group=$groupname]">
<xsl:value-of select="$field/ancestor::adl:form/adl:permission[@group=$groupname]/@permission"/>
</xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:call-template name="property-permission"> <xsl:call-template name="property-permission">
<xsl:with-param name="property" select="$field/ancestor::adl:entity//adl:property[@name=$field/@name]"/> <xsl:with-param name="property" select="$field/ancestor::adl:entity//adl:property[@name=$field/@name]"/>