Category-based permission check not working on Home Page

Components

Labels

Description

Tags "m_CheckPermission" and "c_HasPermission" doesn't work, when used on home page (index.tpl template).

This happens, because current category is detected as "0" on that template, however it's 1 (ID of "Content"/"Home" category). In 4.x versions of In-Portal it indeed was 0. I supposed not all places were properly adapted to such ID change.

I propose, to set current category id ("m_cat_id" variable) to actual ID of "Content"/"Home" category, when it's equals to "0".

Context Information

None

Additional information (do not use)

All places, that compare "m_cat_id" to "0" should be also checked and properly adapted.

Attachments

1

Activity

Dmitry Andrejev 
November 30, 2010 at 6:48 PM

Closing released 5.1.1 task.

Alex 
October 19, 2010 at 8:57 AM

Fix committed to [b]5.1.x branch/b. Commit Message:

Fixes #0000880: Category-based permission check not working on Home Page

Dmitry Andrejev 
October 14, 2010 at 4:46 AM

Good one - tested good, please commit

Alex 
October 5, 2010 at 9:19 PM

To test you can place this code:

C_VIEW: [<inp2:m_CheckPermission permissions="CATEGORY.VIEW"/>]<br/>
M_CAT_ID: <inp2:m_Get name="m_cat_id"/><br/>
C_ID: <inp2:c_Field name="CategoryId"/><br/>
ST_ID: <inp2:st_Field name="CategoryId"/><br/>

in front of <inp2:m_RenderElement name="content" default_element="cms_content"/> tag in "default_design.des.tpl" file, as Phil did to see if 1st line of output changes after applying patch and other lines won't change.

Also test this on some other pages (virtual, template) to see if nothing global was broken.

Fixed

Details

Priority

Assignee

Reporter

Developer

External issue ID

External issue URL

Fix versions

Affects versions

Patch Instructions

Patches must be submitted through Phabricator.

Created October 5, 2010 at 8:24 PM
Updated December 29, 2024 at 9:16 PM
Resolved November 30, 2010 at 6:48 PM