Re: [xwiki-users] evaluate programming rights?

2012-07-27 Thread Caleb James DeLisle
Hi Paul,

$doc.hasProgrammingRights() returns true if 
$xwiki.hasAccessLevel(programming, $doc.getContentAuthor(), 
xwiki:XWiki.XWikiPreferences) is true
and $xcontext.dropPermissions() has not been called in the same request.
What is important is that the contentAuthor of the document has a permission 
called programming on the XWikiPreferences document in the main wiki (if it's 
a wiki farm).
Users who are registered to a subwiki can never have the power to make a 
document have PR
and small changes such as adding an attachment or a comment will not change the 
contentAuthor of the document so the document will still have PR.

I wrote a snippet to grant PR to all documents in a given space.
http://extensions.xwiki.org/xwiki/bin/view/Extension/Give+Programming+Rights+To+Space

Thanks,

Caleb


On 07/24/2012 05:59 PM, Paul Libbrecht wrote:
 
 Hello XWiki ers,
 
 on #xwiki, Sergiu was kind enough to indicate that my current bug, the fact 
 that $!xwiki.getXWiki().Param(...) returns empty is a programming rights 
 issue: the problem seems to be that the resource page, whose rendering is 
 entirely made outside of the wiki-page-content.
 
 And I could verify that by having, in all pages where the above is empty, an 
 output that of $doc.hasProgrammingRight() which is false.
 
 Question 1: how can I evaluate that another page has programming rights?
 
 Question 2: is there a way to give programming rights to everything in a 
 space? to all code in included .vm files?
 
 thanks in advance
 
 Paul
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users
 


___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] evaluate programming rights?

2012-07-24 Thread Paul Libbrecht

Hello XWiki ers,

on #xwiki, Sergiu was kind enough to indicate that my current bug, the fact 
that $!xwiki.getXWiki().Param(...) returns empty is a programming rights issue: 
the problem seems to be that the resource page, whose rendering is entirely 
made outside of the wiki-page-content.

And I could verify that by having, in all pages where the above is empty, an 
output that of $doc.hasProgrammingRight() which is false.

Question 1: how can I evaluate that another page has programming rights?

Question 2: is there a way to give programming rights to everything in a space? 
to all code in included .vm files?

thanks in advance

Paul
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users