diff --git a/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md b/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md index c8bf6d2..932e6dd 100644 --- a/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md +++ b/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md @@ -286,65 +286,42 @@ defined('_JEXEC') or die('Restricted access'); *** ## \demo.php ### Let's look at the JCB Demo component using the admin area of Joomla!, signed in as a Super Administrator. JCB's Editing the Site View in the admin area of the site is where you add the code for the site view entry point for the JCB Demo component, /demo.php. This code has been inserted for you. You will need to supply code for your own components and the code in the JCB Demo component provides the basic elements for any component allowing CRUD (Create, Read, Update Delete) on database table records, in this case, look. + Super Administrator can: * Login to admin as super administrator and create a look. * Add a registered user. * Create a Joomla! menu item for the demo component looks, access should be registered. Registered Users can: -* Edit the look record in the demo_look table, reusing the adminForm form to do so -The registered user id of the logged in user must match the created_by value for it to display. -* First, login as the registered user and select the looks option from the main menu -* The site view looks displays with the Name and Description of the registered user's look and an edit toolbar underneath. -* Click the edit toolbar and display the admin view look, displaying only the form actions defined for that user group. -Save -Save and Close -Close -* The More button was enabled in the JCB demo -- This allowing entry of the additional fields on the form. +* Edit the look record in the demo_look table, reusing the adminForm form to do so. To display, the registered user id of the logged in user must match the created_by value in the record. +* Login as the registered user and select the looks option from the main menu +* Observe the site view looks displays with the Name and Description of the registered user's look and an edit toolbar underneath. +* 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. admin view look so one can edit their own look record in the looks_demo table. By default, access control is only allowed for the super administrator. If access is given in Joomla!'s ACL to the JCB Demo component for let's say the registered group of Joomla! users, the edit button will display below the name and description. This brings up the matter of access control levels or ACL in Joomla! See the text after the view for information or you will not be able to edit a look despite owning it. +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: -If you use Chrome's More Tools - Developer Tools, use the element pointer to find this on the page: +Looking (Site) Access Allowed +Looks Access Allowed +Looks (Site) Access Allowed +Looks Edit Own Allowed -