Changes

Jump to navigation Jump to search
51 bytes added ,  16:32, 27 February 2020
no edit summary
With the {{Code|%perm:allow}} annotation, one or more permission strings can be attached to a RESTXQ function:
<pre classsyntaxhighlight lang="brush:xquery">
(:~ Login page (visible to everyone). :)
declare
</html>
};
</presyntaxhighlight>
The permission strings may denote ids, users, user groups, applications, or any other realms. It is completely up to the user which strings are used, and which functions will be annotated. In the given example code, only the last function has a {{Code|%perm:allow}} annotation.
An example:
<pre classsyntaxhighlight lang="brush:xquery">
import module namespace Session = 'http://basex.org/modules/session';
return web:redirect('/main')
};
</presyntaxhighlight>
Some notes:
The following lines of code complete the image:
<pre classsyntaxhighlight lang="brush:xquery">
declare
%rest:path("/login-check")
web:redirect("/")
};
</presyntaxhighlight>
For a full round trip, check out the source code of the [[DBA]] that is bundled with BaseX.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu