tom li wrote:
> Hello experts,
> 
> I and stats to some page,the code is as following:
> 
>  #if($xwiki.statsService.enabled)
>         {{include document="Stats.Document"/}}
>  #end
> 
> it works,but when I log out, there is error message :
> 
> Caused by: org.xwiki.rendering.macro.MacroExecutionException: Current
> user doesn't have view rights on document [Stats.Document]
>       at 
> org.xwiki.rendering.internal.macro.include.IncludeMacro.execute(IncludeMacro.java:139)
> 
> So how can I add rights permission code?

See http://tinyurl.com/y9w6u7l . You could try:

#if($xwiki.hasAccessLevel("view", $context.user, "Stats.Document") && 
$xwiki.statsService.enabled)
   {{include document="Stats.Document"/}}
#end

Hope this helps,
Marius

> 
> Thansk & Best Regards
> 
> Tom
> _______________________________________________
> 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

Reply via email to