Last modified by Super Admin on 2026/03/22 00:39

From version Icon 21.1 Icon
edited by XWikiGuest
on 2026/03/09 11:57
Change comment: There is no comment for this version
To version Icon 23.1 Icon
edited by Super Admin
on 2026/03/09 12:25
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.XWikiGuest
1 +XWiki.superadmin
Content
... ... @@ -27,7 +27,9 @@
27 27   ## ページをプログラム的に作成
28 28   #set($newDoc = $xwiki.getDocument($targetPage))
29 29   ## SchoolTemplateのコンテンツを参照として設定(テンプレートの include)
30 - $newDoc.setContent('{{include reference="SeitokaiCode.SchoolTemplate" /}}')
30 + ## author="target" により、SchoolTemplateの作者(superadmin)の権限でVelocityを実行
31 + ## これがないと学校ページの作者(一般ユーザー)のscript権限が必要になりエラーになる
32 + $newDoc.setContent('{{include reference="SeitokaiCode.SchoolTemplate" author="target" /}}')
31 31   $newDoc.setTitle($schoolName)
32 32   $newDoc.setParent('Schools.WebHome')
33 33   ## SchoolClassオブジェクトを追加して初期値を設定