Loading...
 
Skip to main content

function user_has_perm_on_object wrongly returns false where categorized but no perms set in cat

Status
Closed
Subject
function user_has_perm_on_object wrongly returns false where categorized but no perms set in cat
Version
1.9.x
Category
  • Error
Feature
Category
Resolution status
Invalid
Submitted by
Nelson Ko
Volunteered to solve
Nelson Ko
Lastmod by
Nelson Ko
Rating
(0)
Description

I'm not setup as a developer right now and anyway don't know enough to know which branch is which... Perhaps someone else can get onto this? Simple fix. Obvious error.

tikilib.php, 1.9 CVS HEAD line 3528, revision 1.656

if ($is_categorized && !empty($categperm) && $$categperm != 'y') {
return (FALSE);
}

Solution

should be

if ($is_categorized && !empty($$categperm) && $$categperm != 'y') {
return (FALSE);
}
---------
In which case? Did your really have a case - or is it only a code reading.

Because so far I know there is no call to this functiopn with categperm= ''?
!empty( $ $categperm) will also be never empty ( all cats are y or n)
PS: I would like also to replace this call in most a the case with get_perm_object - because 1) usually you need all the perms around this object (for the buttons...) 2)the perm on the categ is better integrated - it is easy to connect perm on categ with perm on object
sylvie
---------
koth: to recreate the case, create a new category (without setting any perms). You then put a wiki page in that category. After that, turn off tiki_p_view_categories for anonymous group, if not already done. Try to access that wiki page that you created earlier as anonymous. You will not be able to access it.
------
koth: After discussion with sylvie, this is expected behaviour. The !empty($categperm) does not seem necessary but anyway, the implementation will be different in 1.10. Left as it is.

Importance
9 high
Priority
45
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
908
Created
Monday 16 October, 2006 19:27:01 UTC
by Unknown
LastModif
Monday 14 May, 2007 18:06:56 UTC


Show PHP error messages