Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Joomla 1.5 ACL for custom extension content - is this the right way?
    primarykey
    data
    text
    <p>I am developing a Joomla! 1.5 extention that has two types of registered users, each with access to their particular content.</p> <p>I have done alot of reading on utilising the Joomla ACL implementation to achieve this. I understand that it is based on phpGACL. </p> <p>I am seeking any guidance or advice if what I intend to do is the right approach.</p> <p>Suppose my extension is called "classroom".</p> <p>Suppose I have user types: "student" and "teacher"</p> <p>Both are registered users.</p> <p>"student" has access to "ebooks" "teacher" has access to "classregister"</p> <p>i assume that I use Access Extension Objects that will extend the Access Control Objects.</p> <pre><code>$extACL = &amp; JFactory::getACL(); //define permissions for teacher $extACL-&gt;_mos_add_acl('com_classroom','accessdata','users','registered','usersection','classregister'); //define permissions for student $extACL-&gt;_mos_add_acl('com_classroom','accessdata','users','registered','usersection','ebooks'); </code></pre> <p>Then as need arises, I can check permissions for (say) the "ebooks" area using the following</p> <pre><code>//After checking if it is the right user $user = &amp; JFactory-&gt;getUser(); if(! $user-&gt;authorize('com_classroom','accessdata','usersection','ebooks')) { JError::raiseError('403',JText::_('You are not logged in as a student')); } </code></pre> <p>Have I understood the right use of the Joomla! ACL for my extension or is it wrong? Or will I have to define my own access controls.</p> <p>Hope I made sense.</p> <p>Thanks for your time!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload