This same issue has come up again. Logged on as superadmin on front end. In front end form:
http://localhost/j17-1/index.php?option=com_media&tmpl=component&task=popupUpload&folder=
"You are not authorized to view this resource"
Joomla 1.7.3
The error arises from: /components/com_media/media.php around line 21:
$asset = JRequest::getCmd('asset');
$author = JRequest::getCmd('author');
if (!$asset or
!$user->authorise('core.edit', $asset)
&& !$user->authorise('core.create', $asset)
&& count($user->getAuthorisedCategories($asset, 'core.create')) == 0
&& !($user->id==$author && $user->authorise('core.edit.own', $asset)))
{
return JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
}
$user is in group 8 - super users
$asset is null
$author is null
In the backend under com_media superusers are allowed in all areas of this component.
Why use $asset in this way and not check user permissions like com_content: (views/category/view.html.php)
// Check whether category access level allows access.
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
if (!in_array($category->access, $groups)) {
return JError::raiseError(403, JText::_("JERROR_ALERTNOAUTHOR"));
}