Archived

Adding ACL rules to your component

From Joomla! Documentation

Revision as of 00:06, 5 December 2011 by Mrs.siam (talk | contribs) (Created page with "This tutorial will demonstrate how to add custom action permission to your component down to object level. Normally we familiar with ACL in global configuration level, category l...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page has been archived. This page contains information for an unsupported Joomla! version or is no longer relevant. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

This tutorial will demonstrate how to add custom action permission to your component down to object level. Normally we familiar with ACL in global configuration level, category level and component level. Now we will learn how to add action permission control in our component.

JTable Support[edit]

JTable class has some built-in support for ACL, to use this you have to add one integer field in your table named 'asset_id'. This field will be used to control action control for your object. Do not confuse with 'access', that is only for access permission (read side) as Joomla! separates other actions from read acess.

Normally, we have to override __construct() method in our descendant class. We may also override check() method to validate our data before saving to database. For ACL action support we have to override these methods:-