Changes for page api
Last modified by Ophion Admin on 2026/10/06 19:32
From version 7.1
edited by Ophion Admin
on 2026/10/06 19:32
on 2026/10/06 19:32
Change comment:
There is no comment for this version
To version 6.1
edited by Ophion Admin
on 2026/10/06 17:01
on 2026/10/06 17:01
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -3,8 +3,6 @@ 3 3 #set ($appClass = 'api.Code.apiClass') 4 4 ## Lowercase letters and digits, single hyphens only between the parts 5 5 #set ($namePattern = '[a-z0-9]+(-[a-z0-9]+)*') 6 -## Only users with edit right on the app home page may create APIs 7 -#set ($canCreate = $xwiki.hasAccessLevel('edit', $xcontext.user, "${appSpace}.WebHome")) 8 8 ## Collect all AWM apps: data class name -> app title 9 9 #set ($apps = {}) 10 10 #set ($xwql = "select doc.fullName from Document doc, doc.object(AppWithinMinutes.LiveTableClass) as app order by doc.fullName") ... ... @@ -58,7 +58,7 @@ 58 58 #end 59 59 #end 60 60 #set ($errorMsg = '') 61 -#if ("$!request.createEntry" == '1' && $canCreate)59 +#if ("$!request.createEntry" == '1') 62 62 #if (!$services.csrf.isTokenValid("$!request.form_token")) 63 63 #set ($errorMsg = 'Invalid form token, please try again.') 64 64 #elseif (!$name.matches($namePattern)) ... ... @@ -93,7 +93,6 @@ 93 93 /* Hide the default AWM "Add new entry" button */ 94 94 ul.actions a.action.add, a.action.add { display: none !important; } 95 95 </style> 96 -#if ($canCreate) 97 97 <form action="$doc.getURL()" method="post" class="form-inline"> 98 98 <input type="hidden" name="form_token" value="$!services.csrf.token"/> 99 99 <!-- Changing the app or the field reloads the form without creating anything --> ... ... @@ -119,7 +119,6 @@ 119 119 pattern="$namePattern" title="Lowercase letters, digits and hyphens only"/> 120 120 <button type="submit" name="createEntry" value="1" class="btn btn-primary">Create API</button> 121 121 </form> 122 -#end 123 123 {{/html}} 124 124 {{/velocity}} 125 125