Building on what Harry said....

There's no convenience function in the API do this that I know of, so 
you'd probably have to just query the Security DB for usernames.



Like:



xquery version "1.0-ml";



import module namespace sec="http://marklogic.com/xdmp/security"; at 
"/MarkLogic/security.xqy";

    

declare function local:get-usernames() {

  for $name in /sec:user/sec:user-name/text()

  order by $name

  return $name

};



local:get-usernames()





But you'd have to run that against the Security DB either by using 
xdmp:invoke or by using the dreaded xdmp:eval. And you'd probably want use 
and amp and permissions to restrict this kind of access.



-Ryan

Date: Fri, 6 Apr 2012 12:46:02 -0600
From: dna...@gmail.com
To: general@developer.marklogic.com
Subject: Re: [MarkLogic Dev General] Retrieving a list of users

When I've done this, I use queries against the Security database to get the 
info. You can use Query Console to get a handle on how data is structured in 
the Security DB and I found great success with just using Xpath queries. 

One thing I found difficult to do was distinguish app/real users from system 
accounts, etc. The way I dealt with this was to add xml to the 
sec:password-extra element that contained user details, what applications they 
are users for, etc. The only downside, if it is one, is that you have to invoke 
these queries against the Security DB...

I can give you some code examples, etc. if you have specific questions.
Harry
On Fri, Apr 6, 2012 at 12:26 PM, Steve Carton <st...@chesbay.net> wrote:

Hi -



I need to develop a web-based GUI that will allow an admin user to

easily manage users of a web application. The desire is to have this

limited admin GUI available and integrated into a larger XQuery-based

web interface. I see functions to create, delete and modify Marklogic

users, but I don't see a way to get a list of them. Is there such a

function? Or, is there a way to query the security database to get such

a list?



Thanks,



Steve Carton

_______________________________________________

General mailing list

General@developer.marklogic.com

http://developer.marklogic.com/mailman/listinfo/general




_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general                         
                  
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to