In some cases you want your database records to have a special set of permissions which can override those set for the entire component in its Options. This is especially important if you are using the Joomla Categories, in which case your items may belong to a category, which belongs in another category, which belongs in another category… This cascading of permissions is made easy with Joomla's assets management.
To enabled assets management in your table you need to have an
asset_id
column in your database table. This sets
$this->_trackAssets = true
when your table object is
constructed (no need to do it manually).
Moreover, you MAY have to override the
_getAssetParentId
, _getAssetName
and
_getAssetTitle
methods if your items described by this
table class belong in categories. Look at
\Joomla\CMS\Table\Content
to understand what is going
on.
Finally, your bind()
method needs to be overwritten
so you can call the $this->setRules()
method against the
raw, JSON-encoded permissions data stored in the database table. Saving
rules is automatic; you don't have to handle it yourself.