From 8506cab20ebfe1c4fcaa4268e93e4ef5afa3e722 Mon Sep 17 00:00:00 2001 From: Joseph Geller Date: Thu, 27 Sep 2018 08:57:13 -0500 Subject: [PATCH] Updated 4a. JCB Demo Component Directory, Folders and Files (markdown) --- 4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md b/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md index 4d3dd44..b48f527 100644 --- a/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md +++ b/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md @@ -299,7 +299,7 @@ Registered Users can: * Click the edit toolbar and display the admin view look, displaying only the buttons representing the form actions defined for that user group which are Save, Save and Close, Close. * Click the More button, enabled when the record was entered by the Super Administrator using the admin area of the site. This allows the Registered User to access additional fields on the form. -Let's look at the code behind all of this. By default, the site view looks is not authorized for any user besides the Super Administrator although it displays on the main menu after logging in to a Registered User and above. If access is given in Joomla!'s ACL to the JCB Demo component for the Registered Group of Joomla! users, the view will display after logging in as a Registered User. For this to happen, the Joomla! ACL must allow access to the component as follows using the admin area's main menu option - Components, Demo, Looks, Options, Permissions tab, Registered: +By default, the site view looks is not authorized for any user besides the Super Administrator although it displays on the main menu after logging in to a Registered User and above. If access is given in Joomla!'s ACL to the JCB Demo component for the Registered Group of Joomla! users, the view will display after logging in as a Registered User. For this to happen, the Joomla! ACL must allow access to the component as follows using the admin area's main menu option - Components, Demo, Looks, Options, Permissions tab, Registered: * Looking (Site) Access Allowed * Looks Access Allowed @@ -314,7 +314,11 @@ There is a caveat in the demo that must be taken into consideration. From the ad This Tweak to the Dynamic Get in JCB for the Demo component site view looks Dynamic Get, getListQuery extends it to only include records from the table that are created by the user having the same id as the current user, available from the site view looks $this variable, user id element in the form. The change takes effect once you use JCB to compile the component and install it again using the Joomla! extension installer. The same Tweak is required in the site view looking Dynamic Get, getItem. -Doing the above also ensures only certain actions are allowed for certain users. In our case, a Registered User should only be allowed to Save, Save and Close, and Close when done editing their own look records. Super Administrators by default are allowed all actions on the admin view. Performing the previous instructions also restricts a Registered user's actions to allow only Save, Save and Close, and Close the previous instructions. If you add more permissions, more actions will be allowed such as save and copy. Experiment with the JCB Demo component Joomla! ACL permissions and you can see the effect on what edit buttons appear since components do not need to be compiled using JCB to change these settings. +Doing the above also ensures only certain actions are allowed for certain users. In our case, a Registered User should only be allowed to: +* Save +* Save and Close +* Close +The filter only allows them to edit their own look records. Super Administrators by default are allowed all actions on the admin view. Performing the previous instructions also restricts a Registered user's actions to display only the Save, Save and Close, and Close buttons. If you add more permissions, more actions and hence more buttons will be allowed such as save and copy. Experiment with the JCB Demo component Joomla! ACL permissions and you can see the effect on what edit buttons appear since components do not need to be compiled using JCB to change these settings. Continuing with the edit functionality: * Edit the look record in the demo_look table. It is important you understand this is reusing the admin look edit look at the form tag in the source of the page using your browser (Chrome - Developer tools).