SlideShare a Scribd company logo
1 of 65
Download to read offline
Enrich your extensions with
   Joomla! ACL support
               Sander Potjer
                   @sanderpotjer


       J	
  and	
  Beyond	
  -­‐	
  May	
  20,	
  2012
Sander Potjer?
Twitter:
@sanderpotjer

E-mail:
sander@sanderpotjer.nl

Slides:
http://www.slideshare.net/sanderpotjer/
Joomla! ACL
It took a while...
                                                                      DrupalCon, October 2005
                                                                          Johan Janssens




• http://www.slideshare.net/JohanJanssens/drupalcon-2005-joomla-drupal-and-you-presentation
ACL?!?!
ACL = Access Control List
ACL?!?!
ACL = Access Control List

Access to parts of the website
– e.g. menu / module visibility
– “view” action
ACL?!?!
ACL = Access Control List

Access to parts of the website
– e.g. menu / module visibility
– “view” action


User actions on objects
example: create / edit / edit state / delete article
ACL?!?!
ACL = Access Control List

Access to parts of the website
– e.g. menu / module visibility
– “view” action


User actions on objects
example: create / edit / edit state / delete article
Joomla! 2.5
ACL Overview
• http://community.joomla.org/blogs/community/1252-16-acl.html
• http://community.joomla.org/blogs/community/1252-16-acl.html
User
       • Guest is also a
         ‘user’

       • Users can be
         assigned to one or
         multiple groups
• http://community.joomla.org/blogs/community/1252-16-acl.html
Permissions
Assigned to group (not to a user!)

                                     10 Actions
                                     – Site Login
                                     – Admin Login
                                     – Offline Access (since 1.7)
                                     – Super Admin / Configure
                                     – Access Administration
                                       Interface
                                     – Create
                                     – Delete
                                     – Edit
                                     – Edit State
                                     – Edit Own
• http://community.joomla.org/blogs/community/1252-16-acl.html
Group

        • Users with same permissions

        • Inherited permissions from
          parent groups

        • Unlimited nested groups

        • Keep it simple! Only use
          nested groups if needed
• http://community.joomla.org/blogs/community/1252-16-acl.html
Access Level

               • What is visible for the group
                 (article, menu, module, etc.)

               • Permissions are inherit
                 between Access Levels

               • Even Super Users can not
                 view content on frontend if
                 not assigned
• http://community.joomla.org/blogs/community/1252-16-acl.html
Permissions Settings
 4 possible permission settings

– Not Set

– Inherited

– Allowed

– Denied
Permission Hierarchy (levels)
Level 1: Global configuration
– default permissions settings for actions for a group
Permission Hierarchy (levels)
Level 1: Global configuration
– default permissions settings for actions for a group
Level 2: Component Options
– can override the permissions of Level 1
Permission Hierarchy (levels)
Level 1: Global configuration
– default permissions settings for actions for a group
Level 2: Component Options
– can override the permissions of Level 1
Level 3: Category
– can override the permissions of Level 1 & Level 2
– available for components with categories (Articles, Banners, etc...)
Permission Hierarchy (levels)
Level 1: Global configuration
– default permissions settings for actions for a group
Level 2: Component Options
– can override the permissions of Level 1
Level 3: Category
– can override the permissions of Level 1 & Level 2
– available for components with categories (Articles, Banners, etc...)
Level 4: Item
– can override the permissions of Level 1 & Level 2 & Level 3
– only available for article manager in Joomla core
Permission Hierarchy (levels)
Level 1: Global configuration
– default permissions settings for actions for a group
Level 2: Component Options
– can override the permissions of Level 1
Level 3: Category
– can override the permissions of Level 1 & Level 2
– available for components with categories (Articles, Banners, etc...)
Level 4: Item
– can override the permissions of Level 1 & Level 2 & Level 3
– only available for article manager in Joomla core
Override permissions of higher levels only works if
permission setting is not ‘Denied’!
Inheriting example for ‘Create’ Action


   Level 1



   Level 2



   Level 3



   Level 4



• http://www.theartofjoomla.com/home/5-commentary/84-introducing-the-new-permissions-in-joomla-16.html
Database: #__assets
Database: #__assets: rules names
10 Actions:
– Site Login: core.login.site
– Admin Login: core.login.admin
– Offline Access: core.login.offline
– Super Admin / Configure: core.admin
– Access Administration Interface: core.manager
– Create: core.create
– Delete: core.delete
– Edit: core.edit
– Edit State: core.edit.state
– Edit Own: core.edit.own
Database: #__assets: rules values
Permissions values “Null”, ‘0’ and ‘1’
– Null: Not Set or Inherited
– 0: Denied
– 1: Allowed
Database: #__assets: rules format




   {"core.login.site":{"6":1,"2":1}
Database: #__assets: name format




     com_content.category.19
Database: #__assets
Joomla Basic ACL support
2 actions required
Configure
To configure the access settings via the 'Options' toolbar button

Access Administration Interface
To define which group is able to access/manage the component
18 lines of code
     4 steps
couple minutes
1. Add/modify config.xml
File: administrator/components/com_foobar/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL"
description="JCONFIG_PERMISSIONS_DESC">
         <field name="rules" type="rules"
label="JCONFIG_PERMISSIONS_LABEL" filter="rules"
component="com_foobar" section="component">
              <action name="core.admin" title="JACTION_ADMIN"
description="JACTION_ADMIN_COMPONENT_DESC" />
              <action name="core.manage" title="JACTION_MANAGE"
description="JACTION_MANAGE_COMPONENT_DESC" />
         </field>
    </fieldset>
</config>
2. Add access check
File: administrator/components/com_foobar/foobar.php

defined('_JEXEC') or die('Restricted access');

// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_foobar')) {
      return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
3. Add the 'Options' toolbar button
File: administrator/components/com_foobar/views/foobars/view.html.php

// Options button.
if (JFactory::getUser()->authorise('core.admin', 'com_foobar')) {
      JToolBarHelper::preferences('com_foobar');
}
4. Add one language string
File: administrator/language/en-GB/en-GB.com_foobar.ini

COM_FOOBAR_CONFIGURATION="FooBar Options"
That’s all!
Actually, basic ACL support is
 not optional, it should be a
 requirement for a “native”
   Joomla 2.5 extension.
Adding custom actions
Adding custom actions
    Example: administrator/components/com_foobar/access.xml



<?xml version="1.0" encoding="utf-8" ?>
<access component="com_helloworld">
!     <section name="component">
!     !     <action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
!     !     <action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
!     !     <action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
!     !     <action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
!     !     <action name="foobar.delete.own" title="FOOBAR_DELETE_OWN" description="FOOBAR_DELETE_OWN_DESC" />
!     </section>
!     <section name="message">
!     !     <action name="core.delete" title="JACTION_DELETE" description="COM_HELLOWORLD_ACCESS_DELETE_DESC" />
!     !     <action name="core.edit" title="JACTION_EDIT" description="COM_HELLOWORLD_ACCESS_EDIT_DESC" />
            <action name="foobar.delete.own" title="FOOBAR_DELETE_OWN" description="FOOBAR_DELETE_OWN_DESC" />
!     </section>
</access>
Adding custom actions
   Example: administrator/components/com_foobar/config.xml
<?xml version="1.0" encoding="utf-8"?>
<config>
!      <fieldset
!      !      name="greetings"
!      !      label="COM_FOOBAR_CONFIG_GREETING_SETTINGS_LABEL"
!      !      description="COM_FOOBAR_CONFIG_GREETING_SETTINGS_DESC"
!      >
!      !      <field
!      !      !      name="show_category"
!      !      !      type="radio"
!      !      !      label="COM_FOOBAR_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL"
!      !      !      description="COM_FOOBAR_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC"
!      !      !      default="0"
!      !      >
!      !      !      <option value="0">JHIDE</option>
!      !      !      <option value="1">JSHOW</option>
!      !      </field>
!      </fieldset>
!      <fieldset
!      !      name="permissions"
!      !      label="JCONFIG_PERMISSIONS_LABEL"
!      !      description="JCONFIG_PERMISSIONS_DESC"
!      >
!      !      <field
!      !      !      name="rules"
!      !      !      type="rules"
!      !      !      label="JCONFIG_PERMISSIONS_LABEL"
!      !      !      class="inputbox"
!      !      !      validate="rules"
!      !      !      filter="rules"
!      !      !      component="com_foobar"
!      !      !      section="component"
!      !      />
!      </fieldset>
</config>
Extension X (not so good) example
Extension X (not so good) example
Extension X (not so good) example
Extension X (not so good) example
Action check
Simple action check
File: administrator/components/com_foobar/views/foobars/view.html.php

// Options button.
if (JFactory::getUser()->authorise('core.admin', 'com_foobar')) {
      JToolBarHelper::preferences('com_foobar');
}
Multiple action check
    File: administrator/components/com_foobar/views/foobars/view.html.php
    /**
!     * Setting the toolbar
!     */
!   protected function addToolBar()
!   {
!   !     $canDo = FoobarHelper::getActions();
!   !     JToolBarHelper::title(JText::_('COM_FOOBAR_MANAGER_HELLOWORLDS'), 'foobar');
!   !     if ($canDo->get('core.create'))
!   !     {
!   !     !     JToolBarHelper::addNew('foobar.add', 'JTOOLBAR_NEW');
!   !     }
!   !     if ($canDo->get('core.edit'))
!   !     {
!   !     !     JToolBarHelper::editList('foobar.edit', 'JTOOLBAR_EDIT');
!   !     }
!   !     if (($canDo->get('core.delete')) || ($canDo->get('foobar.delete.own')))
!   !     {
!   !     !     JToolBarHelper::deleteList('', 'foobar.delete', 'JTOOLBAR_DELETE');
!   !     }
!   !     if ($canDo->get('core.admin'))
!   !     {
!   !     !     JToolBarHelper::divider();
!   !     !     JToolBarHelper::preferences('com_foobar');
!   !     }
!   }
Multiple action check
    File: administrator/components/com_foobar/helpers/foobar.php
    /**
!     * Get the actions
!     */
!   public static function getActions($messageId = 0)
!   {!
!   !     jimport('joomla.access.access');
!   !     $user !    = JFactory::getUser();
!   !     $result!   = new JObject;

!   !    if (empty($messageId)) {
!   !    !    $assetName = 'com_foobar';
!   !    }
!   !    else {
!   !    !    $assetName = 'com_foobar.message.'.(int) $messageId;
!   !    }

!   !    $actions = JAccess::getActions('com_foobar', 'component');

!   !    foreach ($actions as $action) {
!   !    !    $result->set($action->name, $user->authorise($action->name, $assetName));
!   !    }

!   !    return $result;
!   }
Multiple action check
File: administrator/components/com_content/helpers/content.php
Displaying permission
      interface
Display permission interface
  File: administrator/components/com_foobar/views/foobar/tmpl/edit.php

 <?php if ($this->canDo->get('core.admin')): ?>
      <div class="width-100 fltlft">
         <?php echo JHtml::_('sliders.start', 'permissions-sliders-'.$this->item->id,
array('useCookie'=>1)); ?>

              <?php echo JHtml::_('sliders.panel', JText::_('COM_HELLOWORLD_FIELDSET_RULES'), 'access-
rules'); ?>
              <fieldset class="panelform">
                 <?php echo $this->form->getLabel('rules'); ?>
                 <?php echo $this->form->getInput('rules'); ?>
              </fieldset>

         <?php echo JHtml::_('sliders.end'); ?>
      </div>
   <?php endif; ?>
Display permission interface
File: administrator/components/com_foobar/views/foobar/tmpl/edit.php
Usage examples in MVC
Usage examples - Model
File: administrator/components/com_content/models/article.php
Usage examples - Model
File: administrator/components/com_content/models/articles.php
Usage examples - View
File: administrator/components/com_content/views/articles/tmpl/default.php
Usage examples - View
File: administrator/components/com_content/views/articles/tmpl/default.php
Usage examples - Controller
File: administrator/components/com_content/controllers/articles.php
Be Creative!
Resources
• http://www.aclmanager.net/news/general/28-is-your-extension-really-
    joomla-17-ready
•   http://www.aclmanager.net/news/general/31-how-to-add-basic-acl-support-to-
    your-extension
•   http://docs.joomla.org/Developing_a_Model-View-
    Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14
•   http://docs.joomla.org/How_to_implement_actions_in_your_code
•   http://community.joomla.org/blogs/community/1252-16-acl.html
•   http://docs.joomla.org/ACL_Tutorial_for_Joomla_1.6
•   http://docs.joomla.org/Access_Control_System_In_Joomla_1.6
•   http://magazine.joomla.org/issues/Issue-May-2012/item/761-Joomla-ACL-
    Configuring-back-end

More Related Content

What's hot

Intro to Joomla Development
Intro to Joomla DevelopmentIntro to Joomla Development
Intro to Joomla DevelopmentAlex Andreae
 
Comparing Joomla CCKs
Comparing Joomla CCKsComparing Joomla CCKs
Comparing Joomla CCKsJustin Herrin
 
Improving Joomla’s Backend User Experience
Improving Joomla’s Backend User ExperienceImproving Joomla’s Backend User Experience
Improving Joomla’s Backend User ExperienceRandy Carey
 
Многопользовательские проекты на WordPress
Многопользовательские проекты на WordPressМногопользовательские проекты на WordPress
Многопользовательские проекты на WordPressNikolay Mironov
 
Justin Herrin Comparing Joomla CCKs from jd12ne
Justin Herrin Comparing Joomla CCKs from jd12neJustin Herrin Comparing Joomla CCKs from jd12ne
Justin Herrin Comparing Joomla CCKs from jd12neJustin Herrin
 
Extending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and ReactExtending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and ReacteZ Systems
 
Clase 19 roles modificada
Clase 19 roles   modificadaClase 19 roles   modificada
Clase 19 roles modificadaTitiushko Jazz
 
Customizing the Django Admin
Customizing the Django AdminCustomizing the Django Admin
Customizing the Django AdminLincoln Loop
 
PLAT-14 Forms Config, Customization, and Extension
PLAT-14 Forms Config, Customization, and ExtensionPLAT-14 Forms Config, Customization, and Extension
PLAT-14 Forms Config, Customization, and ExtensionAlfresco Software
 
Android ActionBar Navigation reloaded
Android ActionBar Navigation reloadedAndroid ActionBar Navigation reloaded
Android ActionBar Navigation reloadedDominik Helleberg
 

What's hot (13)

WordPress 3.3 Feature Tour
WordPress 3.3 Feature TourWordPress 3.3 Feature Tour
WordPress 3.3 Feature Tour
 
Critical extensions
Critical extensionsCritical extensions
Critical extensions
 
Intro to Joomla Development
Intro to Joomla DevelopmentIntro to Joomla Development
Intro to Joomla Development
 
Comparing Joomla CCKs
Comparing Joomla CCKsComparing Joomla CCKs
Comparing Joomla CCKs
 
Improving Joomla’s Backend User Experience
Improving Joomla’s Backend User ExperienceImproving Joomla’s Backend User Experience
Improving Joomla’s Backend User Experience
 
Многопользовательские проекты на WordPress
Многопользовательские проекты на WordPressМногопользовательские проекты на WordPress
Многопользовательские проекты на WordPress
 
Justin Herrin Comparing Joomla CCKs from jd12ne
Justin Herrin Comparing Joomla CCKs from jd12neJustin Herrin Comparing Joomla CCKs from jd12ne
Justin Herrin Comparing Joomla CCKs from jd12ne
 
Extending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and ReactExtending eZ Platform v2 with Symfony and React
Extending eZ Platform v2 with Symfony and React
 
Clase 19 roles modificada
Clase 19 roles   modificadaClase 19 roles   modificada
Clase 19 roles modificada
 
Customizing the Django Admin
Customizing the Django AdminCustomizing the Django Admin
Customizing the Django Admin
 
PLAT-14 Forms Config, Customization, and Extension
PLAT-14 Forms Config, Customization, and ExtensionPLAT-14 Forms Config, Customization, and Extension
PLAT-14 Forms Config, Customization, and Extension
 
Loi code mahoa
Loi code mahoaLoi code mahoa
Loi code mahoa
 
Android ActionBar Navigation reloaded
Android ActionBar Navigation reloadedAndroid ActionBar Navigation reloaded
Android ActionBar Navigation reloaded
 

Similar to Enrich your extensions with Joomla! ACL support

Joomla! ACL - Joomla!Day Germany
Joomla! ACL - Joomla!Day GermanyJoomla! ACL - Joomla!Day Germany
Joomla! ACL - Joomla!Day GermanySander Potjer
 
Joomla ACL introduction, limit site access
Joomla ACL introduction, limit site accessJoomla ACL introduction, limit site access
Joomla ACL introduction, limit site accessSander Potjer
 
Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014Sander Potjer
 
Joomla 2.5 ACL @ Dutch Joomla!Days #jd12nl
Joomla 2.5 ACL @ Dutch Joomla!Days #jd12nlJoomla 2.5 ACL @ Dutch Joomla!Days #jd12nl
Joomla 2.5 ACL @ Dutch Joomla!Days #jd12nlSander Potjer
 
Cutting corners from a wheel -
Cutting corners from a wheel - Cutting corners from a wheel -
Cutting corners from a wheel - kauselot
 
Cairo meetup low code best practices
Cairo meetup low code best practicesCairo meetup low code best practices
Cairo meetup low code best practicesAhmed Keshk
 
Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Vishwash Gaur
 
Alfresco : Implementing Membership and Security
Alfresco  : Implementing Membership and Security	Alfresco  : Implementing Membership and Security
Alfresco : Implementing Membership and Security Wildan Maulana
 
Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Vishwash Gaur
 
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Don Cranford
 
Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Vishwash Gaur
 
24 - Panorama Necto 14 administration - visualization & data discovery solution
24  - Panorama Necto 14 administration - visualization & data discovery solution24  - Panorama Necto 14 administration - visualization & data discovery solution
24 - Panorama Necto 14 administration - visualization & data discovery solutionPanorama Software
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
Improving joomla's backend user experience
Improving joomla's backend user experienceImproving joomla's backend user experience
Improving joomla's backend user experienceLuke Summerfield
 

Similar to Enrich your extensions with Joomla! ACL support (20)

Joomla! ACL - Joomla!Day Germany
Joomla! ACL - Joomla!Day GermanyJoomla! ACL - Joomla!Day Germany
Joomla! ACL - Joomla!Day Germany
 
Joomla ACL introduction, limit site access
Joomla ACL introduction, limit site accessJoomla ACL introduction, limit site access
Joomla ACL introduction, limit site access
 
Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
 
Joomla 2.5 ACL @ Dutch Joomla!Days #jd12nl
Joomla 2.5 ACL @ Dutch Joomla!Days #jd12nlJoomla 2.5 ACL @ Dutch Joomla!Days #jd12nl
Joomla 2.5 ACL @ Dutch Joomla!Days #jd12nl
 
Cutting corners from a wheel -
Cutting corners from a wheel - Cutting corners from a wheel -
Cutting corners from a wheel -
 
Cairo meetup low code best practices
Cairo meetup low code best practicesCairo meetup low code best practices
Cairo meetup low code best practices
 
Joomla Overview
Joomla OverviewJoomla Overview
Joomla Overview
 
Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5
 
What's new in Joomla 1.6?
What's new in Joomla 1.6?What's new in Joomla 1.6?
What's new in Joomla 1.6?
 
Using advanced features in joomla
Using advanced features in joomlaUsing advanced features in joomla
Using advanced features in joomla
 
Alfresco : Implementing Membership and Security
Alfresco  : Implementing Membership and Security	Alfresco  : Implementing Membership and Security
Alfresco : Implementing Membership and Security
 
Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012
 
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5
 
Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5
 
Joomla Presentations
Joomla PresentationsJoomla Presentations
Joomla Presentations
 
Java Server Faces
Java Server FacesJava Server Faces
Java Server Faces
 
Joomla Day1
Joomla  Day1Joomla  Day1
Joomla Day1
 
24 - Panorama Necto 14 administration - visualization & data discovery solution
24  - Panorama Necto 14 administration - visualization & data discovery solution24  - Panorama Necto 14 administration - visualization & data discovery solution
24 - Panorama Necto 14 administration - visualization & data discovery solution
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Improving joomla's backend user experience
Improving joomla's backend user experienceImproving joomla's backend user experience
Improving joomla's backend user experience
 

More from Sander Potjer

Daarom Joomla! - Makkelijk content publiceren
Daarom Joomla! - Makkelijk content publicerenDaarom Joomla! - Makkelijk content publiceren
Daarom Joomla! - Makkelijk content publicerenSander Potjer
 
Daarom Joomla! - Inspiratie uit de praktijk
Daarom Joomla! - Inspiratie uit de praktijkDaarom Joomla! - Inspiratie uit de praktijk
Daarom Joomla! - Inspiratie uit de praktijkSander Potjer
 
Daarom Joomla! - Een fantastische basis
Daarom Joomla! - Een fantastische basisDaarom Joomla! - Een fantastische basis
Daarom Joomla! - Een fantastische basisSander Potjer
 
Performance budget @ Joomla! Performance Expert Sessie
Performance budget @ Joomla! Performance Expert SessiePerformance budget @ Joomla! Performance Expert Sessie
Performance budget @ Joomla! Performance Expert SessieSander Potjer
 
Technieken & tools @ Joomla! Performance Expert Sessie
Technieken & tools @ Joomla! Performance Expert SessieTechnieken & tools @ Joomla! Performance Expert Sessie
Technieken & tools @ Joomla! Performance Expert SessieSander Potjer
 
CDN @ Joomla! Performance Expert Sessie
CDN @ Joomla! Performance Expert SessieCDN @ Joomla! Performance Expert Sessie
CDN @ Joomla! Performance Expert SessieSander Potjer
 
Proxy caching @ Joomla! Performance Expert Sessie
Proxy caching @ Joomla! Performance Expert SessieProxy caching @ Joomla! Performance Expert Sessie
Proxy caching @ Joomla! Performance Expert SessieSander Potjer
 
Server performance @ Joomla! Performance Expert Sessie
Server performance @ Joomla! Performance Expert SessieServer performance @ Joomla! Performance Expert Sessie
Server performance @ Joomla! Performance Expert SessieSander Potjer
 
.htaccess performance @ Joomla! Performance Expert Sessie
.htaccess performance @ Joomla! Performance Expert Sessie.htaccess performance @ Joomla! Performance Expert Sessie
.htaccess performance @ Joomla! Performance Expert SessieSander Potjer
 
Google AMP @ Joomla! Performance Expert Sessie
Google AMP @ Joomla! Performance Expert SessieGoogle AMP @ Joomla! Performance Expert Sessie
Google AMP @ Joomla! Performance Expert SessieSander Potjer
 
Optimaliseer afbeeldingen @ Joomla! Performance Expert Sessie
Optimaliseer afbeeldingen @ Joomla! Performance Expert SessieOptimaliseer afbeeldingen @ Joomla! Performance Expert Sessie
Optimaliseer afbeeldingen @ Joomla! Performance Expert SessieSander Potjer
 
Optimalisatie plugins @ Joomla! Performance Expert Sessie
Optimalisatie plugins @ Joomla! Performance Expert SessieOptimalisatie plugins @ Joomla! Performance Expert Sessie
Optimalisatie plugins @ Joomla! Performance Expert SessieSander Potjer
 
Cache handlers @ Joomla! Performance Expert Sessie
Cache handlers @ Joomla! Performance Expert SessieCache handlers @ Joomla! Performance Expert Sessie
Cache handlers @ Joomla! Performance Expert SessieSander Potjer
 
Performance & Joomla! core @ Joomla! Performance Expert Sessie
Performance & Joomla! core @ Joomla! Performance Expert SessiePerformance & Joomla! core @ Joomla! Performance Expert Sessie
Performance & Joomla! core @ Joomla! Performance Expert SessieSander Potjer
 
Joomla! First - JoomlaDagen 2017 #jd17nl
Joomla! First - JoomlaDagen 2017 #jd17nlJoomla! First - JoomlaDagen 2017 #jd17nl
Joomla! First - JoomlaDagen 2017 #jd17nlSander Potjer
 
Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)
Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)
Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)Sander Potjer
 
Performance & SEO - Joomla SEO Expert Sessie
Performance & SEO - Joomla SEO Expert SessiePerformance & SEO - Joomla SEO Expert Sessie
Performance & SEO - Joomla SEO Expert SessieSander Potjer
 
Social Media & SEO - Joomla SEO Expert Sessie
Social Media & SEO - Joomla SEO Expert SessieSocial Media & SEO - Joomla SEO Expert Sessie
Social Media & SEO - Joomla SEO Expert SessieSander Potjer
 
Joomla 3.6: nieuwe router - Joomla SEO Expert Sessie
Joomla 3.6: nieuwe router - Joomla SEO Expert SessieJoomla 3.6: nieuwe router - Joomla SEO Expert Sessie
Joomla 3.6: nieuwe router - Joomla SEO Expert SessieSander Potjer
 
SEO Audit - Joomla SEO Expert Sessie
SEO Audit - Joomla SEO Expert SessieSEO Audit - Joomla SEO Expert Sessie
SEO Audit - Joomla SEO Expert SessieSander Potjer
 

More from Sander Potjer (20)

Daarom Joomla! - Makkelijk content publiceren
Daarom Joomla! - Makkelijk content publicerenDaarom Joomla! - Makkelijk content publiceren
Daarom Joomla! - Makkelijk content publiceren
 
Daarom Joomla! - Inspiratie uit de praktijk
Daarom Joomla! - Inspiratie uit de praktijkDaarom Joomla! - Inspiratie uit de praktijk
Daarom Joomla! - Inspiratie uit de praktijk
 
Daarom Joomla! - Een fantastische basis
Daarom Joomla! - Een fantastische basisDaarom Joomla! - Een fantastische basis
Daarom Joomla! - Een fantastische basis
 
Performance budget @ Joomla! Performance Expert Sessie
Performance budget @ Joomla! Performance Expert SessiePerformance budget @ Joomla! Performance Expert Sessie
Performance budget @ Joomla! Performance Expert Sessie
 
Technieken & tools @ Joomla! Performance Expert Sessie
Technieken & tools @ Joomla! Performance Expert SessieTechnieken & tools @ Joomla! Performance Expert Sessie
Technieken & tools @ Joomla! Performance Expert Sessie
 
CDN @ Joomla! Performance Expert Sessie
CDN @ Joomla! Performance Expert SessieCDN @ Joomla! Performance Expert Sessie
CDN @ Joomla! Performance Expert Sessie
 
Proxy caching @ Joomla! Performance Expert Sessie
Proxy caching @ Joomla! Performance Expert SessieProxy caching @ Joomla! Performance Expert Sessie
Proxy caching @ Joomla! Performance Expert Sessie
 
Server performance @ Joomla! Performance Expert Sessie
Server performance @ Joomla! Performance Expert SessieServer performance @ Joomla! Performance Expert Sessie
Server performance @ Joomla! Performance Expert Sessie
 
.htaccess performance @ Joomla! Performance Expert Sessie
.htaccess performance @ Joomla! Performance Expert Sessie.htaccess performance @ Joomla! Performance Expert Sessie
.htaccess performance @ Joomla! Performance Expert Sessie
 
Google AMP @ Joomla! Performance Expert Sessie
Google AMP @ Joomla! Performance Expert SessieGoogle AMP @ Joomla! Performance Expert Sessie
Google AMP @ Joomla! Performance Expert Sessie
 
Optimaliseer afbeeldingen @ Joomla! Performance Expert Sessie
Optimaliseer afbeeldingen @ Joomla! Performance Expert SessieOptimaliseer afbeeldingen @ Joomla! Performance Expert Sessie
Optimaliseer afbeeldingen @ Joomla! Performance Expert Sessie
 
Optimalisatie plugins @ Joomla! Performance Expert Sessie
Optimalisatie plugins @ Joomla! Performance Expert SessieOptimalisatie plugins @ Joomla! Performance Expert Sessie
Optimalisatie plugins @ Joomla! Performance Expert Sessie
 
Cache handlers @ Joomla! Performance Expert Sessie
Cache handlers @ Joomla! Performance Expert SessieCache handlers @ Joomla! Performance Expert Sessie
Cache handlers @ Joomla! Performance Expert Sessie
 
Performance & Joomla! core @ Joomla! Performance Expert Sessie
Performance & Joomla! core @ Joomla! Performance Expert SessiePerformance & Joomla! core @ Joomla! Performance Expert Sessie
Performance & Joomla! core @ Joomla! Performance Expert Sessie
 
Joomla! First - JoomlaDagen 2017 #jd17nl
Joomla! First - JoomlaDagen 2017 #jd17nlJoomla! First - JoomlaDagen 2017 #jd17nl
Joomla! First - JoomlaDagen 2017 #jd17nl
 
Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)
Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)
Complexe pagina's gebruiksvriendelijk (Joomla Page Builders)
 
Performance & SEO - Joomla SEO Expert Sessie
Performance & SEO - Joomla SEO Expert SessiePerformance & SEO - Joomla SEO Expert Sessie
Performance & SEO - Joomla SEO Expert Sessie
 
Social Media & SEO - Joomla SEO Expert Sessie
Social Media & SEO - Joomla SEO Expert SessieSocial Media & SEO - Joomla SEO Expert Sessie
Social Media & SEO - Joomla SEO Expert Sessie
 
Joomla 3.6: nieuwe router - Joomla SEO Expert Sessie
Joomla 3.6: nieuwe router - Joomla SEO Expert SessieJoomla 3.6: nieuwe router - Joomla SEO Expert Sessie
Joomla 3.6: nieuwe router - Joomla SEO Expert Sessie
 
SEO Audit - Joomla SEO Expert Sessie
SEO Audit - Joomla SEO Expert SessieSEO Audit - Joomla SEO Expert Sessie
SEO Audit - Joomla SEO Expert Sessie
 

Recently uploaded

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 

Recently uploaded (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 

Enrich your extensions with Joomla! ACL support

  • 1. Enrich your extensions with Joomla! ACL support Sander Potjer @sanderpotjer J  and  Beyond  -­‐  May  20,  2012
  • 4. It took a while... DrupalCon, October 2005 Johan Janssens • http://www.slideshare.net/JohanJanssens/drupalcon-2005-joomla-drupal-and-you-presentation
  • 5. ACL?!?! ACL = Access Control List
  • 6. ACL?!?! ACL = Access Control List Access to parts of the website – e.g. menu / module visibility – “view” action
  • 7. ACL?!?! ACL = Access Control List Access to parts of the website – e.g. menu / module visibility – “view” action User actions on objects example: create / edit / edit state / delete article
  • 8. ACL?!?! ACL = Access Control List Access to parts of the website – e.g. menu / module visibility – “view” action User actions on objects example: create / edit / edit state / delete article
  • 12. User • Guest is also a ‘user’ • Users can be assigned to one or multiple groups
  • 14. Permissions Assigned to group (not to a user!) 10 Actions – Site Login – Admin Login – Offline Access (since 1.7) – Super Admin / Configure – Access Administration Interface – Create – Delete – Edit – Edit State – Edit Own
  • 16. Group • Users with same permissions • Inherited permissions from parent groups • Unlimited nested groups • Keep it simple! Only use nested groups if needed
  • 18. Access Level • What is visible for the group (article, menu, module, etc.) • Permissions are inherit between Access Levels • Even Super Users can not view content on frontend if not assigned
  • 20. Permissions Settings 4 possible permission settings – Not Set – Inherited – Allowed – Denied
  • 21. Permission Hierarchy (levels) Level 1: Global configuration – default permissions settings for actions for a group
  • 22. Permission Hierarchy (levels) Level 1: Global configuration – default permissions settings for actions for a group Level 2: Component Options – can override the permissions of Level 1
  • 23. Permission Hierarchy (levels) Level 1: Global configuration – default permissions settings for actions for a group Level 2: Component Options – can override the permissions of Level 1 Level 3: Category – can override the permissions of Level 1 & Level 2 – available for components with categories (Articles, Banners, etc...)
  • 24. Permission Hierarchy (levels) Level 1: Global configuration – default permissions settings for actions for a group Level 2: Component Options – can override the permissions of Level 1 Level 3: Category – can override the permissions of Level 1 & Level 2 – available for components with categories (Articles, Banners, etc...) Level 4: Item – can override the permissions of Level 1 & Level 2 & Level 3 – only available for article manager in Joomla core
  • 25. Permission Hierarchy (levels) Level 1: Global configuration – default permissions settings for actions for a group Level 2: Component Options – can override the permissions of Level 1 Level 3: Category – can override the permissions of Level 1 & Level 2 – available for components with categories (Articles, Banners, etc...) Level 4: Item – can override the permissions of Level 1 & Level 2 & Level 3 – only available for article manager in Joomla core Override permissions of higher levels only works if permission setting is not ‘Denied’!
  • 26. Inheriting example for ‘Create’ Action Level 1 Level 2 Level 3 Level 4 • http://www.theartofjoomla.com/home/5-commentary/84-introducing-the-new-permissions-in-joomla-16.html
  • 28. Database: #__assets: rules names 10 Actions: – Site Login: core.login.site – Admin Login: core.login.admin – Offline Access: core.login.offline – Super Admin / Configure: core.admin – Access Administration Interface: core.manager – Create: core.create – Delete: core.delete – Edit: core.edit – Edit State: core.edit.state – Edit Own: core.edit.own
  • 29. Database: #__assets: rules values Permissions values “Null”, ‘0’ and ‘1’ – Null: Not Set or Inherited – 0: Denied – 1: Allowed
  • 30. Database: #__assets: rules format {"core.login.site":{"6":1,"2":1}
  • 31. Database: #__assets: name format com_content.category.19
  • 33. Joomla Basic ACL support
  • 34. 2 actions required Configure To configure the access settings via the 'Options' toolbar button Access Administration Interface To define which group is able to access/manage the component
  • 35. 18 lines of code 4 steps couple minutes
  • 36. 1. Add/modify config.xml File: administrator/components/com_foobar/config.xml <?xml version="1.0" encoding="utf-8"?> <config> <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" description="JCONFIG_PERMISSIONS_DESC"> <field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" filter="rules" component="com_foobar" section="component"> <action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" /> <action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" /> </field> </fieldset> </config>
  • 37. 2. Add access check File: administrator/components/com_foobar/foobar.php defined('_JEXEC') or die('Restricted access'); // Access check. if (!JFactory::getUser()->authorise('core.manage', 'com_foobar')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); }
  • 38. 3. Add the 'Options' toolbar button File: administrator/components/com_foobar/views/foobars/view.html.php // Options button. if (JFactory::getUser()->authorise('core.admin', 'com_foobar')) { JToolBarHelper::preferences('com_foobar'); }
  • 39. 4. Add one language string File: administrator/language/en-GB/en-GB.com_foobar.ini COM_FOOBAR_CONFIGURATION="FooBar Options"
  • 41.
  • 42. Actually, basic ACL support is not optional, it should be a requirement for a “native” Joomla 2.5 extension.
  • 44. Adding custom actions Example: administrator/components/com_foobar/access.xml <?xml version="1.0" encoding="utf-8" ?> <access component="com_helloworld"> ! <section name="component"> ! ! <action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" /> ! ! <action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" /> ! ! <action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" /> ! ! <action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" /> ! ! <action name="foobar.delete.own" title="FOOBAR_DELETE_OWN" description="FOOBAR_DELETE_OWN_DESC" /> ! </section> ! <section name="message"> ! ! <action name="core.delete" title="JACTION_DELETE" description="COM_HELLOWORLD_ACCESS_DELETE_DESC" /> ! ! <action name="core.edit" title="JACTION_EDIT" description="COM_HELLOWORLD_ACCESS_EDIT_DESC" /> <action name="foobar.delete.own" title="FOOBAR_DELETE_OWN" description="FOOBAR_DELETE_OWN_DESC" /> ! </section> </access>
  • 45. Adding custom actions Example: administrator/components/com_foobar/config.xml <?xml version="1.0" encoding="utf-8"?> <config> ! <fieldset ! ! name="greetings" ! ! label="COM_FOOBAR_CONFIG_GREETING_SETTINGS_LABEL" ! ! description="COM_FOOBAR_CONFIG_GREETING_SETTINGS_DESC" ! > ! ! <field ! ! ! name="show_category" ! ! ! type="radio" ! ! ! label="COM_FOOBAR_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL" ! ! ! description="COM_FOOBAR_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC" ! ! ! default="0" ! ! > ! ! ! <option value="0">JHIDE</option> ! ! ! <option value="1">JSHOW</option> ! ! </field> ! </fieldset> ! <fieldset ! ! name="permissions" ! ! label="JCONFIG_PERMISSIONS_LABEL" ! ! description="JCONFIG_PERMISSIONS_DESC" ! > ! ! <field ! ! ! name="rules" ! ! ! type="rules" ! ! ! label="JCONFIG_PERMISSIONS_LABEL" ! ! ! class="inputbox" ! ! ! validate="rules" ! ! ! filter="rules" ! ! ! component="com_foobar" ! ! ! section="component" ! ! /> ! </fieldset> </config>
  • 46. Extension X (not so good) example
  • 47. Extension X (not so good) example
  • 48. Extension X (not so good) example
  • 49. Extension X (not so good) example
  • 51. Simple action check File: administrator/components/com_foobar/views/foobars/view.html.php // Options button. if (JFactory::getUser()->authorise('core.admin', 'com_foobar')) { JToolBarHelper::preferences('com_foobar'); }
  • 52. Multiple action check File: administrator/components/com_foobar/views/foobars/view.html.php /** ! * Setting the toolbar ! */ ! protected function addToolBar() ! { ! ! $canDo = FoobarHelper::getActions(); ! ! JToolBarHelper::title(JText::_('COM_FOOBAR_MANAGER_HELLOWORLDS'), 'foobar'); ! ! if ($canDo->get('core.create')) ! ! { ! ! ! JToolBarHelper::addNew('foobar.add', 'JTOOLBAR_NEW'); ! ! } ! ! if ($canDo->get('core.edit')) ! ! { ! ! ! JToolBarHelper::editList('foobar.edit', 'JTOOLBAR_EDIT'); ! ! } ! ! if (($canDo->get('core.delete')) || ($canDo->get('foobar.delete.own'))) ! ! { ! ! ! JToolBarHelper::deleteList('', 'foobar.delete', 'JTOOLBAR_DELETE'); ! ! } ! ! if ($canDo->get('core.admin')) ! ! { ! ! ! JToolBarHelper::divider(); ! ! ! JToolBarHelper::preferences('com_foobar'); ! ! } ! }
  • 53. Multiple action check File: administrator/components/com_foobar/helpers/foobar.php /** ! * Get the actions ! */ ! public static function getActions($messageId = 0) ! {! ! ! jimport('joomla.access.access'); ! ! $user ! = JFactory::getUser(); ! ! $result! = new JObject; ! ! if (empty($messageId)) { ! ! ! $assetName = 'com_foobar'; ! ! } ! ! else { ! ! ! $assetName = 'com_foobar.message.'.(int) $messageId; ! ! } ! ! $actions = JAccess::getActions('com_foobar', 'component'); ! ! foreach ($actions as $action) { ! ! ! $result->set($action->name, $user->authorise($action->name, $assetName)); ! ! } ! ! return $result; ! }
  • 54. Multiple action check File: administrator/components/com_content/helpers/content.php
  • 56. Display permission interface File: administrator/components/com_foobar/views/foobar/tmpl/edit.php <?php if ($this->canDo->get('core.admin')): ?> <div class="width-100 fltlft"> <?php echo JHtml::_('sliders.start', 'permissions-sliders-'.$this->item->id, array('useCookie'=>1)); ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_HELLOWORLD_FIELDSET_RULES'), 'access- rules'); ?> <fieldset class="panelform"> <?php echo $this->form->getLabel('rules'); ?> <?php echo $this->form->getInput('rules'); ?> </fieldset> <?php echo JHtml::_('sliders.end'); ?> </div> <?php endif; ?>
  • 57. Display permission interface File: administrator/components/com_foobar/views/foobar/tmpl/edit.php
  • 59. Usage examples - Model File: administrator/components/com_content/models/article.php
  • 60. Usage examples - Model File: administrator/components/com_content/models/articles.php
  • 61. Usage examples - View File: administrator/components/com_content/views/articles/tmpl/default.php
  • 62. Usage examples - View File: administrator/components/com_content/views/articles/tmpl/default.php
  • 63. Usage examples - Controller File: administrator/components/com_content/controllers/articles.php
  • 65. Resources • http://www.aclmanager.net/news/general/28-is-your-extension-really- joomla-17-ready • http://www.aclmanager.net/news/general/31-how-to-add-basic-acl-support-to- your-extension • http://docs.joomla.org/Developing_a_Model-View- Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14 • http://docs.joomla.org/How_to_implement_actions_in_your_code • http://community.joomla.org/blogs/community/1252-16-acl.html • http://docs.joomla.org/ACL_Tutorial_for_Joomla_1.6 • http://docs.joomla.org/Access_Control_System_In_Joomla_1.6 • http://magazine.joomla.org/issues/Issue-May-2012/item/761-Joomla-ACL- Configuring-back-end