Motivation
The advised mode in TWiki when saving a topic is to check permissions, lock the file, save the topic, and unlock. However,
TWiki::Store::saveTopic checks permissions again. There probably was the intention to make this check optional based on some parameter.
Evidence for this is that
TWiki::Func::saveTopicText explicitly gives this choice, but when it bottoms out in
saveTopic the permissions are nevertheless checked again in spite of the documentation stating that permission checking is dependent on the provided option.
Further, there is one situation when
saveTopic does not check for permissions, which is when no user is given. However, that scenario does not quite make sense, as if no user is given, the
RCS backend complains.
This observation explains why there are several redundant permission checks in the logs.
This proposal originated at
SaveByAdmin.
Description and Documentation
saveText takes a number of options. Add one more option:
ignorePermissions which, if true, would cause the topic to be saved without again checking permissions. If the option is not given our false,
saveTopic behaves as currently, with one exception. It is not allowed to omit the user.
Examples
Impact
Implementation
The implementation is a one line change in
TWiki::Func::saveTopic, inserting the test for the flag instead of the test for the user flag.
--
Contributors: ThomasWeigert - 2010-09-22
Discussion
Makes sense to add this parameter.
I renamed the topic to a more explicit name.
--
PeterThoeny - 2010-09-22
No concerns have been raised, this is now a proposal that is
AcceptedBy7DayFeedbackPeriod.
This is a small and safe enough feature that we can take into the next TWiki-5.0 patch release, e.g. not just for
IstanbulRelease.
--
PeterThoeny - 2010-10-02
This is not yet implemented. I change it from
HelsinkiRelease to
IstanbulRelease.
--
PeterThoeny - 2011-03-26