I was working on adding a new view permission and found this issue.
I'll explain that by code example:
The loop here filters the resources that the user don't have permission to see.
The issue is that there is no check to ensure that there is something left in this array, and it's getting passed to the template as is.
So, for example, User A has few resources.
User B go to the resources page of User A, but he has no permission to view resources (permissions[resource][view]).
The result is that User B can access to this page, but all the resources are filtered.
I'll explain that by code example:
PHP:
class XenResource_ControllerPublic_Author extends XenForo_ControllerPublic_Abstract
{
...
public function actionView()
{
...
foreach ($resources AS $key => $resource)
{
if (!$resourceModel->canViewResourceAndContainer($resource, $resource))
{
unset($resources[$key]);
}
}
...
}
...
}
The loop here filters the resources that the user don't have permission to see.
The issue is that there is no check to ensure that there is something left in this array, and it's getting passed to the template as is.
So, for example, User A has few resources.
User B go to the resources page of User A, but he has no permission to view resources (permissions[resource][view]).
The result is that User B can access to this page, but all the resources are filtered.
Last edited: