[xwiki-users] setUser admin
Hi all, how can I execute a procedure using Admin while I'm logged as another User? Tahnks Raffo -- View this message in context: http://www.nabble.com/setUser-admin-tp15461068p15461068.html Sent from the XWiki- Users mailing list archive at Nabble.com.
raffovi wrote:
Hi all,
how can I execute a procedure using Admin while I'm logged as another User?
Tahnks Raffo
Using programming rights. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu Dumitriu wrote:
raffovi wrote:
Hi all,
how can I execute a procedure using Admin while I'm logged as another User?
Tahnks Raffo
Using programming rights.
But this is only true in the controller, isn't it? Thanks! -- Ricardo RodrÃguez Your EPEC Network ICT Team
How?? Can you tell me sometring more? Thanks Raffo Sergiu Dumitriu-2 wrote:
raffovi wrote:
Hi all,
how can I execute a procedure using Admin while I'm logged as another User?
Tahnks Raffo
Using programming rights. -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://www.nabble.com/setUser-admin-tp15461068p15466402.html Sent from the XWiki- Users mailing list archive at Nabble.com.
raffovi wrote:
How??
Can you tell me sometring more? Thanks Raffo
Well, I don't know what are you calling a procedure. Let me guess it is a piece of code (Groovy for instance) embedded in a XWiki document. It must be edited by an user having programming rights. Then, any user accessing this document will get the same result. <% import groovy.sql.Sql db = Sql.newInstance("jdbc:mysql://hostname/databasename", "username", "password", "com.mysql.jdbc.Driver") List samplesIA = db.rows('SELECT * FROM saltmines s where es like "I" and ess like "A" and ids>=1') %> n: <% println "${samplesIA.size()}"%> For instance, this simple Groovy script will return the number of rows in the SQL query passed to the db.rows function only if it is edited and saved by an user having programming rights (and provided the right host, username, password and JDBC library are in place). If the document containing this code is edited by any other user without those rights, the code won't be executed. There are tones of much better examples and useful pieces of code in the XWiki site. HTH, Ricardo -- Ricardo RodrÃguez Your EPEC Network ICT Team
participants (3)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
raffovi -
Sergiu Dumitriu