ADMIN permission needed for basex:read(...)
Sunday, 27 June 2010 · 2 messages
SS
Sandra Maria Silcot27 Jun 2010 05:47 #
Fellow basex users,
Test case:
(as 'admin' user:) run file1.xq, containing:
let $test := basex:read('/tmp/222.readme')
return <test>{$test}</test>Returns, as expected:
<test>readme from basex
</test>But when run as any other user WITHOUT admin privilige (from the log):
RUN /tmp/222 Error: ADMIN permission needed. 7.75 ms
Behaviour is the same if the file is copied to be inside the basex home directory e.g. basex:read('222.readme').
I would like to be able to read files in basex queries as a non-admin user. But perhaps the admin restriction on this behaviour is by design?
Cheers,
Sandra
AW
Andreas Weiler27 Jun 2010 10:37 #
Dear Sandra,
you need to have Admin permission, cause the query accesses
files on the server and that should only be possible for admins. You can change that by replacing the following:
line 149 in Fun.java: if(!ctx.context.user.perm(User.ADMIN)) to: if(!ctx.context.user.perm(User.READ))
I hope this helps,
cheers Andreas
Quoted text · Sandra Maria Silcot · 32 lines
Sandra Maria Silcot schrieb: > Fellow basex users, > > Test case: > (as 'admin' user:) run file1.xq, containing: > > let $test := basex:read('/tmp/222.readme') > return <test>{$test}</test> > > Returns, as expected: > <test>readme from basex > </test> > > But when run as any other user WITHOUT admin privilige (from the log): > > RUN /tmp/222 Error: ADMIN permission needed. 7.75 ms > > Behaviour is the same if the file is copied to be inside the basex home > directory e.g. basex:read('222.readme'). > > I would like to be able to read files in basex queries as a non-admin > user. But perhaps the admin restriction on this behaviour is by design? > > Cheers, > > Sandra > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery