Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. // Check the view access to the article (the model has already computed the values).
  2. if ($item->params->get('access-view') == false && ($item->params->get('show_noauth', '0') == '0'))
  3. {
  4. JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
  5. return;
  6. }
  7.  
  8. // Compute view access permissions.
  9. if ($access = $this->getState('filter.access'))
  10. {
  11. // If the access filter has been set, we already know this user can view.
  12. $data->params->set('access-view', true);
  13. }
  14. else
  15. {
  16. // If no access filter is set, the layout takes some responsibility for display of limited information.
  17. $user = JFactory::getUser();
  18. $groups = $user->getAuthorisedViewLevels();
  19.  
  20. if ($data->catid == 0 || $data->category_access === null)
  21. {
  22. $data->params->set('access-view', in_array($data->access, $groups));
  23. }
  24. else
  25. {
  26. $data->params->set('access-view', in_array($data->access, $groups) && in_array($data->category_access, $groups));
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement