Hi Zach,

Curious error message. The security role is created automatically at
installation of MarkLogic. I can only think of one reason, that you are
somehow running security functions against a database other than Security.
This seems to run just fine in QConsole:

xquery version "1.0-ml";

let $user := 'test'
let $desc := 'Test user'
let $pass := 'test'
let $roles := ()
let $perms := ()
let $colls := ()
let $params := map:map()
let $_ := map:put($params, "user", $user)
let $_ := map:put($params, "desc", $desc)
let $_ := map:put($params, "pass", $pass)
let $_ := map:put($params, "roles", $roles)
let $_ := map:put($params, "perms", $perms)
let $_ := map:put($params, "colls", $colls)
return
  xdmp:eval('
    xquery version "1.0-ml";

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

    declare variable $params as map:map external;

    let $user := map:get($params, "user")
    let $desc := map:get($params, "desc")
    let $pass := map:get($params, "pass")
    let $roles := map:get($params, "roles")
    let $perms := map:get($params, "perms")
    let $colls := map:get($params, "colls")
    return
      sec:create-user($user, $desc, $pass, $roles, $perms, $colls)
    ',
    (xs:QName("params"), $params),
    <options xmlns="xdmp:eval">
       <database>{xdmp:database("Security")}</database>
    </options>
  )

Kind regards,
Geert

> -----Oorspronkelijk bericht-----
> Van: [email protected] [mailto:general-
> [email protected]] Namens Michael Blakeley
> Verzonden: maandag 25 februari 2013 23:47
> Aan: MarkLogic Developer Discussion
> Onderwerp: Re: [MarkLogic Dev General] Help with error: SEC-ROLEDNE:
> (err:FOER0000) Role does not exist: sec:role-name = security
>
> I can't run your code sample because the eval string isn't quoted, and
there
> is no security import.
>
>     XDMP-UNDFUN: (err:XPST0017) Undefined function sec:create-user()
>
> Try the example at https://docs.marklogic.com/sec:create-user - keeping
in
> mind that it uses the role 'Temporary', which does not exist by default.
>
> -- Mike
>
> On 25 Feb 2013, at 13:27 , "Dunlap, Zachariah" <[email protected]> wrote:
>
> > I'm attempting to try and work with this
> sample:https://github.com/marklogic/userlogin/blob/master/registration-
> form.xqywhich is a simple registration form to create user accounts in
> MarkLogic.
> >
> > I'm using:
> >
> > xdmp:eval(sec:create-user($user,$desc,$password,(),(),()),
> > (),
> > <options xmlns="xdmp:eval">
> >       <database>{xdmp:database("Security")}</database>
> >     </options>)
> >
> > But I continue to get the error: SEC-ROLEDNE: (err:FOER000) Role does
> not exist: sec:role-name = security
> >
> > I've confirmed that my Security database is attached to the database
I'm
> working with. It seems to me that xdmp:eval is not working here but I
don't
> understand why if that is the case.
> >
> > Appreciate any assistance.
> >
> > Thanks,
> >
> > Zach
> >
> > The information contained in this communication is intended for the
use
> > of the designated recipients named above. If the reader of this
> > communication is not the intended recipient, you are hereby notified
> > that you have received this communication in error, and that any
review,
> > dissemination, distribution or copying of this communication is
strictly
> > prohibited. If you have received this communication in error, please
> > notify The Associated Press immediately by telephone at +1-212-621-
> 1898
> > and delete this email. Thank you.
> > [IP_US_DISC]
> >
> >
> > msk dccc60c6d2c3a6438f0cf467d9a4938
> >
> > _______________________________________________
> > General mailing list
> > [email protected]
> > http://developer.marklogic.com/mailman/listinfo/general
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to