Index: xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/api/Context.java =================================================================== --- xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/api/Context.java (revision 8456) +++ xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/api/Context.java Sat Mar 15 15:58:08 CET 2008 @@ -222,6 +222,14 @@ } } + public void resetProgrammingRightsChecker() { + getXWikiContext().put(PROGRAMMING_RIGHTS_CHECKER_FLAG, false); + } + + public boolean haveProgrammingRightsBeenChecked() { + return (Boolean) getXWikiContext().get(PROGRAMMING_RIGHTS_CHECKER_FLAG); + } + public void setFinished(boolean finished) { getXWikiContext().setFinished(finished); Index: xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/api/Api.java =================================================================== --- xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/api/Api.java (revision 8456) +++ xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/api/Api.java Sat Mar 15 15:58:08 CET 2008 @@ -36,7 +36,9 @@ * non-core plugins but better do it now rather than after the 1.0 release... */ protected XWikiContext context; - + + protected static String PROGRAMMING_RIGHTS_CHECKER_FLAG = "programmingrightschecked"; + /** * @param context the XWiki Context object * @see #getXWikiContext() @@ -73,6 +75,7 @@ public boolean hasProgrammingRights() { com.xpn.xwiki.XWiki xwiki = context.getWiki(); + context.put(PROGRAMMING_RIGHTS_CHECKER_FLAG, true); return xwiki.getRightService().hasProgrammingRights(context); }