As always I'm tinkering around in my IDE. Today's challenge is to set up view level ACL rules for each of the various managers (list/form views) in my test management component.
First I added the required sections to the access.xml file
<?xml version="1.0" encoding="UTF-8"?>
<access component="com_babelu_exams">
<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="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
</section>
<section name="category">
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_CATEGORY_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_CATEGORY_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_CATEGORY_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_CATEGORY_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_CATEGORY_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_CATEGORY_DESC" />
</section>
<section name="level">
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_LEVEL_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_LEVEL_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_LEVEL_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_LEVEL_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_LEVEL_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_LEVEL_DESC" />
</section>
<section name="exam">
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_EXAM_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_EXAM_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_EXAM_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_EXAM_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_EXAM_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_EXAM_DESC" />
</section>
<section name="section">
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_SECTION_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_SECTION_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_SECTION_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_SECTION_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_SECTION_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_SECTION_DESC" />
</section>
<section name="problem">
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_PROBLEM_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_PROBLEM_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_PROBLEM_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_PROBLEM_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_PROBLEM_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_PROBLEM_DESC" />
</section>
<section name="result">
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_RESULT_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_RESULT_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_RESULT_DESC" />
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_RESULT_DESC" />
</section>
Then I tried to add these to my config.xml under the permissions fieldset
<!-- SOF PERMISSIONS -->
<fieldset name="permissions" description="JCONFIG_PERMISSIONS_DESC"
label="JCONFIG_PERMISSIONS_LABEL">
<field name="rules" type="rules" component="com_babelu_exams"
filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL"
section="component" />
<field name="rules" type="rules" component="com_babelu_exams"
filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL"
section="category" />
</fieldset>
<!-- EOF PERMISSIONS -->
However this didn't work as the category rules overwrote the component rules. So I tried making rules an array
<!-- SOF PERMISSIONS -->
<fieldset name="permissions" description="JCONFIG_PERMISSIONS_DESC"
label="JCONFIG_PERMISSIONS_LABEL">
<field name="rules[]" type="rules" component="com_babelu_exams"
filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL"
section="component" />
<field name="rules[]" type="rules" component="com_babelu_exams"
filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL"
section="category" />
</fieldset>
<!-- EOF PERMISSIONS -->
but this had the same effect. So I tried appending the section to the component attribute, but this just caused the entire permissions control to go blank.
So does anyone know if what I am trying to do is possible within the com_config component view?
The reason I want to have this at the component level is because I'm trying to achieve full cascading ACL. Where in the super admin can set ACL to the component-> the view-> the record. Which will allow me to hid sections of the component that are not relative to the current users access permissions.
So if you know how this could be done using com_config please let me know. =^D I'll be searching for a solution in the mean time, if I find it I'll post.
Happy Joomla!ng