Loading...
 
Skip to main content

Watch structures from wiki pages - permission denied

Status
Closed
Subject
Watch structures from wiki pages - permission denied
Version
4.x
Category
  • Error
  • Patch
Feature
Wiki (page view, edit, history, rename, etc)
Watch (email notifications of changes)
Wiki Structure (book & table of content)
Resolution status
Fixed or Solved
Submitted by
herzrein
Volunteered to solve
Arild Berg
Lastmod by
Arild Berg
Rating
(0)
Description

When on a wiki page on my tiki, I have the options available to watch the specific page or to "Monitor the sub-structure". When clicking on the latter, I am redirected to a permission denied page and the watch for the sub-structure is not set.

Even admin is being denied the permission to set a sub-structure watch on a wiki page.

Setting a watch on a sub-structure inside the structure-admin menu works fine for any permitted, though.

Solution

On version 4.1 the following code can be found in tiki-index.php line number 411:

Copy to clipboard
if (($_REQUEST['watch_action'] == 'add_desc' || $_REQUEST['watch_action'] == 'remove_desc') && $objectperms->watch_structure ) { $access->display_error( $page, tra('Permission denied'), '403'); }

If i am not mistaken, $objectperms->watch_structure should return true, if the rights are given to watch the structure. So having the rights AND requesting a watch will result in permission denied, which is basicly the opposite of the intended.

The following code works for me an should be the appropriate fix (as mentioned, if I am not mistaken).

Copy to clipboard
if (($_REQUEST['watch_action'] == 'add_desc' || $_REQUEST['watch_action'] == 'remove_desc') && !$objectperms->watch_structure ) { $access->display_error( $page, tra('Permission denied'), '403'); }

$objectperms->watch_structure simply negated.

Importance
5
Priority
25
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2985
Created
Thursday 14 January, 2010 11:34:23 UTC
by herzrein
LastModif
Saturday 03 September, 2011 23:00:46 UTC


Show PHP error messages