Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Check the view access to the article (the model has already computed the values).
- if ($item->params->get('access-view') == false && ($item->params->get('show_noauth', '0') == '0'))
- {
- JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
- return;
- }
- // Compute view access permissions.
- if ($access = $this->getState('filter.access'))
- {
- // If the access filter has been set, we already know this user can view.
- $data->params->set('access-view', true);
- }
- else
- {
- // If no access filter is set, the layout takes some responsibility for display of limited information.
- $user = JFactory::getUser();
- $groups = $user->getAuthorisedViewLevels();
- if ($data->catid == 0 || $data->category_access === null)
- {
- $data->params->set('access-view', in_array($data->access, $groups));
- }
- else
- {
- $data->params->set('access-view', in_array($data->access, $groups) && in_array($data->category_access, $groups));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement