Actions

Difference between revisions of "ACL Technique in Joomla!"

From Joomla! Documentation

(added intro to skeleton and added the sql for the assets database table)
(Introduction)
Line 4: Line 4:
  
 
== Introduction ==
 
== Introduction ==
TODO: short intro about different parts in the system that work together as one Access Control.
+
TODO: short intro about different parts that work together as one Access Control system.
  
 
== The #__assets table ==
 
== The #__assets table ==

Revision as of 07:42, 24 August 2012

Joomla PlatformJoomla 2.5Joomla 3.0

A technical overview of how Access Control is implemented in Joomla!.

Contents

Introduction

TODO: short intro about different parts that work together as one Access Control system.

The #__assets table

The #__assets database table has the following structure (MySql):

CREATE TABLE IF NOT EXISTS `#__assets` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
  `parent_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set parent.',
  `lft` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set lft.',
  `rgt` int(11) NOT NULL DEFAULT '0' COMMENT 'Nested set rgt.',
  `level` int(10) unsigned NOT NULL COMMENT 'The cached level in the nested tree.',
  `name` varchar(50) NOT NULL COMMENT 'The unique name for the asset.',
  `title` varchar(100) NOT NULL COMMENT 'The descriptive title for the asset.',
  `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_asset_name` (`name`),
  KEY `idx_lft_rgt` (`lft`,`rgt`),
  KEY `idx_parent_id` (`parent_id`)
);

TODO: describe the Assets database table. Fields, layout and purpose.

Also see: Fixing the assets table

JTableAsset

TODO: describe the methods of JTableAsset, a JTableNested.

Also see:

JAccessRule and JAccessRules

TODO: describe the methods of AccessRule and JAccessRules

Also see:

JAccess

TODO: describe the (static) methods and (static) properties of JAccess

Also see:

Users, Usergroups and View Access Levels

Used tables and classes

Also see: http://docs.joomla.org/Access_Control_System_In_Joomla_1.6

JUser authorisation methods and properties

TODO: describe the authorisation methods and properties of JUser: authorise(), authorisedLevels(), getAuthorisedCategories(), getAuthorisedGroups(), getAuthorisedViewLevels(), $_authActions, $_authGroups, $_authLevels

Also see:

JTable methods and properties for storing access permissions

TODO: describe the JTable methods and properties for storing access permissions: getRules(), setRules(), etc.

http://docs.joomla.org/JTable is only for 1.5 and lacks those new methods and properties

Also see:

access.xml

TODO: describe the use of the access.xml file

How it all comes together

TODO: describe how the above parts are used together in a workflow

Further reading

More information on Joomla!'s Access Control can be found on the following pages:

Contributors