Hi, Daniel
first of all, you should not edit the XWiki.CalendarSheet to use
$xwiki.getDocument("XWiki.CalendarSheet") as the document: this way you
will add all new events in the CalendarSheet document and print the
events in this document as well: this is a little strange since a
Sheet's purpose is to print other documents and not hold objects and
data. Anyway, this is only a convention and is your decision to follow
it or not.
I tried the very code you sent me with an admin user and a normal user
to whom I only gave edit rights for the XWiki space (though this is NOT
ok, it is necessary for one to add events in XWiki.CalendarSheet). I
couldn't manage to reproduce the behaviour you're talking about but it
seems that is caused by the document's author rights:
- when a user edits the page (adds an event), it becomes the author of
the document and then,
- when the document is displayed (the velocity code is interpreted) the
author's rights are checked
which means that when your 'normal user' gets set as the document
author, he misses some rights; when the admin edits the page (though
making no change at all) he gets set as the author and, /voila!/,
everything gets displayed properly.
This might be happening if the velocity code calls a function that
requires programming rights. I had a look at the code you sent me and
didn't find one, though. (as I mentioned, it didn't reproduce on my side).
Hope this helps,
Anca
Daniel Bertinshaw wrote:
Hi,
I have re-written the Xwiki.CalendarSheet code to add the calendar
event object to $xwiki.getDocument("XWiki.CalendarSheet") rather than
$doc (reason being, I want to include it in other contexts/pages).
It works fine, until another user adds an event, then the events in
the calendar display disappear, and re-appear if I edit the page and
make no changes: oddly, the changes disappear for everyone and
re-appear globally too.
If I use my own account and add an even, there’s no issue (im an
admin, my test account is a normal user: I have tried fiddling with
the rights).
Any help?
(code attached)
------------------------------------------------------------------------
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs