/
Show "No Permission" page inline [5.2.2-B1]
Show "No Permission" page inline [5.2.2-B1]
Currently when user has access violation on website we're redirecting him/her to the "no_permission" template. There are several side effects from this approach:
- user no longer sees url of the page which caused access violation
- the HTTP response code is now 200 instead of 401
Solution
Proposing to show "No Permission" page inline instead of redirecting to it.
- create "kUrlManager::show401($template = null)" method:
- similar to "kUrlManager::show404"
- will be sending "401" HTTP response code
- will use "No Permission" template if none given directly
- change top part (that configures redirect) of "kRequestManager::processPermissionError" method to:
- use "kUrlManager::show401" method
- get "$event" redirect params and do a SetVar on them right away (since no redirect will be happening)
- change top part (that configures redirect) of "kDBEventHandler::_processItemLoadingError" method to use "kUrlManager::show401" method
- change part (that configures no permission redirect) of "kPermissionsHeleper::getPermissionTemplate" method to:
- use "kUrlManager::show401" method
- pass $params['no_permissions_template'] to it, when available and "null" otherwise
- doing SetVar right away (remove debug mode check) instead of setting keys into "$redirect_params" array