Re: [jgen] ACL: access.xml and config.xml

861 views
Skip to first unread message

Michael Babker

unread,
Jul 22, 2012, 3:06:10 PM7/22/12
to joomla-de...@googlegroups.com
access.xml is preferred so you can use the JAccess API.

-Michael

Please pardon any errors, this message was sent from my iPhone.

On Jul 22, 2012, at 1:11 PM, vinnyboy <vincen...@hotmail.com> wrote:

Hi,

I'm trying to implement permissions for a component I write.  Which file should hold the actions, access.xml or config.xml?

grtz

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/24KZz2zXMOcJ.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

vinnyboy

unread,
Jul 22, 2012, 4:10:03 PM7/22/12
to joomla-de...@googlegroups.com
thanks for the reply...
so I don't need config.xml then?  I saw a tutorial which uses config.xml.
and the joomla hello_world uses both files....


Michael Babker

unread,
Jul 22, 2012, 4:18:13 PM7/22/12
to joomla-de...@googlegroups.com
config.xml is needed for your component's configuration.  access.xml is used to set up the ACL.


-Michael

Please pardon any errors, this message was sent from my iPhone.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/5EbW6U0PrnEJ.

vinnyboy

unread,
Jul 22, 2012, 4:38:05 PM7/22/12
to joomla-de...@googlegroups.com
But i still need to add a fieldset to config.xml then? 
I tried a lot of combinations, but the actions i add in the xml file just won't show up...

I install the component, then click on 'options' , that's where i should see my custom actions, no?

Michael Babker

unread,
Jul 22, 2012, 4:52:19 PM7/22/12
to joomla-de...@googlegroups.com
You'll need a fieldset, yes.  Look at com_content's config.xml to get an idea what you'll need to do.


-Michael

Please pardon any errors, this message was sent from my iPhone.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/HIM854GEGH0J.

Alan Hartless

unread,
Jul 22, 2012, 4:55:05 PM7/22/12
to joomla-de...@googlegroups.com
Have a read through http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14. That's what I used to ad acl to my component.

Thanks,
Alan

--
Alan Hartless
HartlessByDesign, LLC
http://hartlessbydesign.com
1.832.387.4233
#end

vinnyboy

unread,
Jul 22, 2012, 4:58:09 PM7/22/12
to joomla-de...@googlegroups.com
Hi,

I tried this tutorial (14), and if i add an action there it works fine.  however, when i add it from scratch to my own component, there's only 4 actions showing:

configure

Vincent Naert

unread,
Jul 22, 2012, 5:09:02 PM7/22/12
to joomla-de...@googlegroups.com
I think that when i'm clicking options after installing the component, that i'm not seeing the options of my component, but the options of the installer...
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.

vinnyboy

unread,
Jul 22, 2012, 6:10:04 PM7/22/12
to joomla-de...@googlegroups.com
I didn't have a backend yet, which i created now.  When i click 'options' in the admin section of my component, i get

500 - An error has occurred.

XML file did not load


any ideas...?  the xml files are both in place....

vinnyboy

unread,
Jul 22, 2012, 6:15:39 PM7/22/12
to joomla-de...@googlegroups.com
the xml load problem is solved... i used the wrong component name in
JToolBarHelper::preferences('com_componentname');

piotr_cz

unread,
Jul 23, 2012, 4:11:15 AM7/23/12
to Joomla! General Development
Are you sure that the XML is valid?
I've used to get this errors when XML parser could not parse the file.
XML may be quite sensitive and errors may be caused by things you
would never expect (eg. multiline comments).

If you are not using IDE with XML support, search for online XML
validators to check for errors.

Vincent Naert

unread,
Jul 23, 2012, 4:43:14 PM7/23/12
to joomla-de...@googlegroups.com
hi,
yes, the xml is valid, this problem is solved. when I click on 'options', I
can choose 'denied' for a specific group. however, when i reload, my change
is not saved...

--------------------------------------------------
From: "piotr_cz" <pkoni...@hotmail.com>
Sent: Monday, July 23, 2012 10:11 AM
To: "Joomla! General Development" <joomla-de...@googlegroups.com>
Subject: [jgen] Re: ACL: access.xml and config.xml
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.

vinnyboy

unread,
Jul 23, 2012, 4:46:59 PM7/23/12
to joomla-de...@googlegroups.com
this is my config.xml file:


<?xml version="1.0" encoding="utf-8"?>
<config>   
    <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" description="JCONFIG_PERMISSIONS_DESC">
        <field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" filter="rules" component="paddles" section="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" />
        </field>
    </fieldset>
</config>


vinnyboy

unread,
Jul 23, 2012, 4:58:55 PM7/23/12
to joomla-de...@googlegroups.com
Must say that I don't have an access.xml file now.  I followed this tutorial: http://www.aclmanager.net/blog/general/31-how-to-add-basic-acl-support-to-your-extension and it only uses config.xml...

vinnyboy

unread,
Jul 26, 2012, 4:36:23 PM7/26/12
to joomla-de...@googlegroups.com
hello,
still didn't get it to work...
when i add the file access.xml, then i get the error

500 - An error has occurred.

XML file did not load


Could someone please tell me what i'm doing wrong?

below are the files:

config.xml


<?xml version="1.0" encoding="utf-8"?>
<config>   
    <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" description="JCONFIG_PERMISSIONS_DESC">
        <field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" filter="rules" component="com_paddles" section="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" />
        </field>
    </fieldset>
</config>


access.xml:

<?xml version="1.0" encoding="utf-8" ?>
<access component="com_paddles">
    <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" />
    </section>
</access>

 

vinnyboy

unread,
Jul 29, 2012, 11:43:03 AM7/29/12
to joomla-de...@googlegroups.com
the error remains if i make both files empty...

On Saturday, July 28, 2012 11:47:16 AM UTC+2, UZ wrote:
Delete both permissions code in both config.xml and access.xml and then try again. Your xml issue could be because of invalid path given or some typing mistake in name in the installer xml file, removing the code and trying will confirm you if the issue has to do with ACL or something else.

Usman Zaheer

unread,
Jul 29, 2012, 5:29:15 PM7/29/12
to joomla-de...@googlegroups.com
See, that means its not able to find your installer file or maybe some other xml file that you are mentioning in installer file. Nothing to do with ACL.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/G_IXebQ7PUQJ.

To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.



--
Regards,
Usman Zaheer

What consumes your thoughts controls your life

Reply all
Reply to author
Forward
0 new messages