-
-
Notifications
You must be signed in to change notification settings - Fork 178
036 Setting Site View Permission
Hi I would like to show you how to set the site view permission the Site view permission is really related to the front end of any site view Since it usually by Default set not allowed And that is basically because We have 00:00:22 The problem where That data is controlled By the Global settings of the component And unless you write some custom script to add that Global settings to the database for permission It actually doesn't have those permissions set and because it's not set it's by Default always said to not allowed Now let me explain that on a code level to you Ok we will use sermon distributor which is One of the demo components that is available and if you are 00:00:57 Interested in buying access to this demo component It obviously has site views So If we open the options tab You see there's a permissional or tab And if we search for sight You see there is category site access Plural and category Site Access singular there's also preacher site access and preachers And series and series list 00:01:38 And sermon And all these various site accesses Literally saying whether the public Will have access Now by Default as I said It is said to inherit And inherit will actually say not allowed Now they are there's something that I've done to try and accommodate this problem In JCB So Let's close out here and look at some of the code I have done there so I will have to go to component Builder 00:02:12 And then to components And I'll open sermon distributor Then I will go to settings And then sight views I will click add And Now you will see that we have here A value called default View Now what the default view really is Is that the view 00:02:45 That The component will Direct you to If you are accessing a view That you as a user don't have access to So Usually we would set the default View to not have an access Control So Will say ok the default View 00:03:12 Doesn't have access control That means it's actually open and public to all And then we could Explain on this view How to get access for example to the rest of the component . For because you could see in what user group the user is and you can by that determines some messages Ok So that means whenever you have obviously there can only be one default view even if you select more than One the first one the compiler gets to will become the default view the next one will be ignored 00:03:52 So they can only be one at the moment it says that here select the only one and so if you have an Access for categories and it's not yet set It will throw the user back to for example here preachers Now What is the advantage of this it Simply negates the error page So did you don't get a loop where the The permission just never gets resolved so just goes into a loop and then crash the site This prevents that but it obviously doesn't solve our permission structure of completely But it is at least a first step towards trying to resolve it so you would say it This is your default page don't give the default page permissional structure so if any of the other pages is Accessed 00:04:43 it will divert to the default page And now the next step that we have to try and address this problem Is some custom scripting That you can add Which will show After installation so let me show you some of that The component where we actually have this shown is the demo component So you can just open the PHP tab And in the PHP tab you see That it has a enqueue message 00:05:19 In the post flight in stalled blocks basically gets the factory Get application first set the component Global setting and the permissions in the option 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 And then this is just an info Message that comes up 00:05:54 Basically after install So that is another way that we've tried to help the user realise that he needs to Add some now you can obviously Change this into a link Become very fancy Or You could Even add Custom script here That updates 00:06:16 The This components promotional structure And actually adds the public to to have access to the site views These are some of the ways that we are trying to resolve the permissional restraints Of Site views Now let's look at this, I was saying earlier at the code level so forgive me for taking so long to get So here we have the access file open of sermon distributor And if we do a search here Site 00:07:00 You see that it has the site access values set for the component Now When we look at The front end of the component Open categories You see that here it is asking whether the user Has that access And then if it doesn't It does a redirect and then redirects to the default page you see that Now let's open the default page 00:07:32 And The ideal of the default page Is that if the default page is not the site route It will If It cannot access the default page it will actually add this error And then redirect to the site root Which being the websites homepage And so that's kind of how we trying to Prevent the This permissional structure from interfering with your user experience Now if we go back to the component 00:08:10 The Sermon Distributer component And we again open the site views This time I change it that is doesn't have access I actually save it that way Go to the compiler Compile Sermon distributor and install Ok now let's go back to the code Now you'll see That it doesn't have any of that checks in the preachers file 00:08:57 Only in the category File And it still redirects to preachers Which in effect means that this one will no longer give any errors But it will show these errors Which relates to the fact that they cannot see The the categories Now 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 To show Maybe a message of how to purchase access or something Yeah we could still look at that you do realise that this stage JCB does have the the option to actually customise any section of code So by using what is known as the custom code implementation Now I'm not gonna 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 use your own implementation upon these measures 00:10:10 Well that is a a quick demonstration or explanation on how to manage The different permissional structures for JCB regarding the site front-end So if you do not want that Control you can simply obviously just put it off But 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 Aldo that is a nice to have there are more pressing things that we'll focus on First
- Home
- Beta Testing
- Custom Code
- PHP Settings
- Demo Component
-
Tutorials
- Hello World JCB
- Intro JCB Guide
- JCB Installation Steps
- Planning Components
- Field Type Overview
- Basic Fields Creation
- Admin View Management
- Advanced Field Usage
- Admin Component Integration
- Component Setting Customization
- Scripting Components
- Component FTP Options
- Dynamic Get Method
- Site View DynamicGet
- Site View Templates
- Template Setup Guide
- Layout Configuration Steps
- Custom Admin Management
- Adding Site Views
- Custom Admin Integration
- MySQL Demo Tweaking
- Global JCB Settings
- Custom Time Field
- User Helper Integration
- Email Helper Usage
- Message Store Email
- List View Unescape
- Export Import Customization
- Overwrite Custom Fields
- List Field Filtering
- Automatic Code Import
- Manual Code Implementation
- Component Export Import
- Custom Admin Buttons
- Translation Management
- Site View Permissions
- Component SQL Updates
- Site Edit Configuration
- JCB Backup System
- Helper Structure Integration
- JCB v2.5 Upgrade
- Tab Setup Guide
- JCB v2.6 Release
- Extended HelloWorld
- Field Rule Validation
- Community Snippets Intro
- Snippet Forking Tutorial
- Pull Request Snippets
- Library Manager Area
- Excel-based Translation
- Dynamic Router Details
- Database Auto Updates
- Subform Quick Demo
- VDM Package Import
- Dynamic File Inclusion
- File Field Upload
- Drag-n-Drop Upload
- Quick HelloWorld JCB
- Non-database Fields
- Dashboard Customization
- Menu Prefix Toggle
- Community JCB Packages
- Collaborative JCB Workflow
- JCB Package Install
- JCB JAB18 Event
- Convenient New Fields
- Component Language Strings
- Library Functionality Anticipation
- Join Field Relations
- License Template Change
- Code Reusability
- Local Dev Environment
- Extended Field Types
- Joomla Custom Fields
- Custom Field Expansion
- Site View Listing
- Run Expansion Method
- Form Site View
- Field URL Update
- Additional Helper Methods
- Field Validation Rules
- New Placeholder Feature
- Component Config Params
- Per-field Default Values