Access denied on a site view

27 views
Skip to first unread message

o...@utsch.biz

unread,
Oct 23, 2020, 5:41:24 AM10/23/20
to Joomla Component Builder
Hi all,

I have created a site view B from a copy of another site view A. Site view A is working properly and is accessible for guests as it's intended to be.
But when I try to access the new site view B, I get the error message "Not authorised to view ViewB!"
I have checked all permissions that I can think of, and Guest access is enabled as inherited, exactly the same as in the original site view A.
Anyone have an idea where the denial is coming from? When I access it with the super user account it all works fine, but the mentioned view must be accessible for any guest alike.
Any hint highly welcome, I find no more alternatives where to search.

Oliver

dormasta

unread,
Oct 28, 2020, 11:21:35 AM10/28/20
to Joomla Component Builder, o...@utsch.biz
I have the same issue, but with "Warning, Not found or access denied!"

o...@utsch.biz

unread,
Oct 28, 2020, 2:05:28 PM10/28/20
to Joomla Component Builder, dormasta, o...@utsch.biz
Hi dormasta,
I looked through the respective video from Llewellyn and found the related situation. I had created the site view from antoher working view, but I forgot in the joomla configuration settings to allow this respective site view to open for public access. As you my see in below screenshot, I went to Joonmla Configuration page and chose my component and activated the permission tab. You may see in the screenshot below that I did enable the public access at this point from where it is inherited.
When I had cloned my second site view, it was actually a copy but a new entry in the permissions which is by default disabled. After I had switched the cloned site view as well to enable it all worked fine. In the video it's explaind that this is Joomla behaviour by default. It could be automated by a post install script (which I will not need in my app).

However all above applies when you get the error message that access to the view in general is not allowed. When you get the error message you stated above "Not found or access denied", the reason may be a different one as it was in my case. My dynamic get which feeds into the site view is based on a base main table another table joined by an outer join. As it was an outer join, I didn't expect to have any problems here. But I had activated a filter to search for records with published = 1 not only in th emain tables but as well in the joined table. This was causing that the query would somtimes not pull any data - actually in these cases when there was no match in the outer joined table.
My solution was to apply a null value subsitution. I chnaged the original clause 
"where b.published = 1" 
into 
"where IFNULL(b.published,1) = 1" 
so that this filter is still appplied for matching records which solved the problem on my end.
Now my query returns valid records in all cases and the mentioned error message doesn't appear anymore.

Cheers,
Oliver
Reply all
Reply to author
Forward
0 new messages