On 2/2/10 7:02 PM, vmassol (SVN) wrote:
Author: vmassol
Date: 2010-02-02 19:02:33 +0100 (Tue, 02 Feb 2010)
New Revision: 26614
Modified:
platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js
platform/web/trunk/standard/src/main/webapp/templates/javascript.vm
Log:
XWIKI-4841: Section editing links should not appear on pages for which users don't
have edit rights
Modified: platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js
===================================================================
--- platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js 2010-02-02
17:19:46 UTC (rev 26613)
+++ platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js 2010-02-02
18:02:33 UTC (rev 26614)
@@ -337,7 +337,7 @@
*/
insertSectionEditLinks: function() {
// Insert links only in view mode and for xwiki/2.0 documents.
- if (XWiki.docsyntax == "xwiki/2.0"&& XWiki.contextaction ==
"view") {
+ if (XWiki.docsyntax == "xwiki/2.0"&& XWiki.contextaction ==
"view"&& XWiki.hasEdit == "true") {
// Section count starts at one, not zero.
var sectioncount = 1;
Modified: platform/web/trunk/standard/src/main/webapp/templates/javascript.vm
===================================================================
--- platform/web/trunk/standard/src/main/webapp/templates/javascript.vm 2010-02-02
17:19:46 UTC (rev 26613)
+++ platform/web/trunk/standard/src/main/webapp/templates/javascript.vm 2010-02-02
18:02:33 UTC (rev 26614)
@@ -36,6 +36,7 @@
XWiki.docisnew = $!doc.isNew();
XWiki.docsyntax = "$!doc.getSyntaxId()";
XWiki.blacklistedSpaces = [ #foreach($space in $blacklistedSpaces)#if($velocityCount>
1),#end"$space"#end ];
+XWiki.hasEdit = "$hasEdit";
why not using a boolean ?
XWiki.hasEdit = #if($hasEdit) true #else false #end;
Jerome.
> window.docviewurl = "${doc.getURL('view')}";
> window.docediturl = "${doc.getURL('edit')}";
> window.docsaveurl = "${doc.getURL('save')}";