Updated 036 Setting Site View Permission (markdown)

Amigo 2019-07-26 08:24:23 +02:00
parent be29477750
commit bc93896774
1 changed files with 9 additions and 4 deletions

@ -22,12 +22,17 @@ The Default View is that view to which the component will direct you, if a view
This is an info message comes up after installation:
'First set the component global setting and the permissions in the options area or the front end of the component will not work as expected. Please note that each view on the front end has access and permissions. So if you would like the public to access those views, they must be given the access and permission.' [00:05:54](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m54s) You can change this(See video) into a link, and even add custom script here, that updates this component's permissional structure, and adds the public to have access to the site views. It some of the ways to resolve the permission restraints of site views.
### Looking Into Code - Site Root
### Site Root - In The Code
[00:06:38](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m38s)
<<<<<<<<
Let's look at it at code level. Here is the access file of Sermon Distributor, and if a search is performed: 'Site'. [00:07:00](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m00s) It may be seen that it has the site access values set for the component. If the front end of the component is opened and then categories, it can be seen that it is asking whether the user has that access, and if it does not, it does a redirect, then redirects to the default page. Open the default page. [00:07:32](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m32s) The ideal of the default page, is that if the default page is not the site root, it cannot access the default page. It will add this error, and redirect to the site root, which being the websites homepage. This had been done to prevent this permission structure from interfering with your user experience.
Let's look at it at code level. Here is the access file of Sermon Distributor, and if a search is performed: 'Site'. [00:07:00](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m00s) It may be seen that it has the site access values set for the component. At the front end of the component, open categories, it can be seen here, that it is asking whether the user has that access, and if it does not, it does a redirect, then redirects to the default page. Let's open the default page. [00:07:32](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m32s) The ideal of the default page, is that if the default page is not the site route, it cannot access the default page. It will add this error, and redirect to the site root, which being the websites homepage. That's how we trying to prevent this permission structure from interfering with your user experience.
[00:08:04](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m04s)
Now if we go back to the Sermon Distributor component, and again open the Site views, this time I changed it so that it does not have access. It is saved that way. Go to the compiler, compile Sermon Distributor and install. Let's go back to the code. It may be seen that it does not have any of that checks in the Preachers file only in the category file. [00:08:57](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m57s) It still redirects to Preachers, which in effect means that this one will no longer give any errors, but it will show these ('COM_SERMONDISTRIBUTOR_NOT_AUTHORISED_TO_VIEW_CATECORIES'),'errors'); errors, which relates to the fact that they cannot see the categories. An advancement that we might consider, is to add a field to the component, where the user can change these errors to show maybe a message of how to purchase access.
Now if we go back to the sermon distributor component, [00:08:10](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m10s) and we again open the site views, this time I change it that is doesn't have access. I save it that way. Go to the compiler, compile sermon distributor and install. Let's go back to the code. You'll see that it doesn't have any of that checks in the preachers file [00:08:57](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m57s) only in the category file. It still redirects to preachers, which in effect means that this one will no longer give any errors, but it will show these ('COM_SERMONDISTRIBUTOR_NOT_AUTHORISED_TO_VIEW_CATECORIES'),'errors'); errors, which relates to the fact that they cannot see the categories. I think some of the advancements that we might still think on doing, is maybe add a field to the component, where the user can change these errors [00:09:31](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m31s) to show maybe a message of how to purchase access or something. You do realize that at this stage JCB does have the the option to customize any section of code by using what is known as the custom code implementation. I'm not going to demonstrate that, please go look and review those videos. They are on YouTube where you can literally change this whole code block here, and then use your own implementation upon these measures. [00:10:10](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m10s) Well that is a a quick demonstration or explanation on how to manage the different permission structures for JCB regarding the site front-end. If you do not want that control, you can simply just put it off. I realize that most of you might want to add some custom scripting that adds permissions to the database for that component. That's little bit beyond the scope of where JCB is at the moment. Although that is a nice to have, there are more pressing things that we'll focus on.
### Custom Code Implementation
[00:09:35](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m35s)
At this stage JCB does have the the option to customize any section of code by using what is known as the Custom Code Implementation. For more detail on this feature, please go to YouTube where it is explained how to change this whole code block and how to use your own implementation upon these measures. [00:10:10](https://www.youtube.com/watch?v=gWjQjdhYqXI&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m10s) This was a demonstration how to manage the different permission structures for JCB regarding the site front-end. If you do not want that control, simply just put it off.