Tags:
create new tag
view all tags

Feature Proposal: TWiki::Store::saveAttachment can optionally ignore permissions

Motivation

In some special cases, we need to allow people who don't have topic change permission to save attachments. E.g. When a user doesn't have topic change permission views a page having DirectedGraphPlugin, it leads to oops page.

Description and Documentation

Just like TWiki::Store::saveTopic checkes "$options->{ignorePermissions}", we can also make TWiki::Store::saveAttachment bypass checking access permission according to its "$opts->{ignorePermissions}" value.

Examples

  1. Make TWiki session disabled by setting $cfg{UseClientSessions} = 0
  2. Create a topic with below content
<dot >
digraph G {
    subgraph cluster_c0 {a0 -> a1 -> a2 -> a3}
    subgraph cluster_c1 {
        b0 -> b1 -> b2 -> b3;
        label="Group B";
    }
    x -> a0 [style=dotted];
    x -> b0;
    a1 -> a3 [style=bold, label="a1 to a3"];
    a3 -> a0;
    a0 [shape=box, fontname=Courier, fontsize=11];
    a1 [color=red];
    a3 [label="Label\nfor a3"];
    label="Cole's Example";
}
</dot> 
<!--
   * Set ALLOWTOPICCHANGE = Main.YaojunFei
-->
3. View the page created above with another user who don't have topic change permission.
4. oops, permission denied page will be displayed.

Impact

Implementation

  1. Check "$opts->{ignorePermissions}" in "TWiki::Store::saveTopic". If true, then skip $this->{session}->security->checkAccessPermission check.
  2. Pass in "$opts->{ignorePermissions}" when invoking "$this->saveTopic"

-- Contributors: Yaojun Fei - 2013-03-14

Discussion

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2013-10-13 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.