Skip to content

Instantly share code, notes, and snippets.

@tuurma
Created April 12, 2019 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuurma/fe09263644fcec7fec14d99f66d1688b to your computer and use it in GitHub Desktop.
Save tuurma/fe09263644fcec7fec14d99f66d1688b to your computer and use it in GitHub Desktop.
moving from xmldb:change-user to sm
xquery version "3.1";
sm:create-group('boys'),
sm:create-group('girls'),
sm:create-group('existsol'),
(: create 3 accounts with personal groups and additional group :)
sm:create-account('magda', 'm-pass', ('girls', 'existsol')),
sm:create-account('lars', 'l-pass', ('boys', 'existsol')),
sm:create-account('joern', 'l-pass', ('boys', 'existsol')),
for $u in ('magda', 'lars', 'joern')
return
<get-user-groups>{$u} : {sm:get-user-groups($u)}</get-user-groups>
,
for $u in ('magda', 'lars', 'joern', 'boys', 'girls', 'existsol')
return
<get-group-members>{$u} : {sm:get-group-members($u)}</get-group-members>
@line-o
Copy link

line-o commented Apr 12, 2019

sm:passwd will then only work for the currently logged in user, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment