CodeIgniter Forums
[LIBRARY] XACL(v:0.01a) - XML Access Control List - Enables simple ACL management with an XML ACL file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: [LIBRARY] XACL(v:0.01a) - XML Access Control List - Enables simple ACL management with an XML ACL file (/thread-25854.html)



[LIBRARY] XACL(v:0.01a) - XML Access Control List - Enables simple ACL management with an XML ACL file - El Forum - 12-28-2009

[eluser]nedloh312[/eluser]
This is the first library i have ever released for public ever (Including before CodeIgniter:O!), so please go easy!

This library is aimed at creating a simple to use, easy to manage ACL. The inspiration case from mx_acl which didn't suit all my needs so i decided to start it again.

The XML file Format (acl.xml) is quite easy to understand as you can see here:
Code:
<acl>
    <pages>
        <page>
            <hrefs>&lt;!--Unlimited URI's per rule--&gt;
                <href>admin/edit</href>
                <href>admin/update</href>
                <href>admin/delete</href>
            </hrefs>
            <allowed>4</allowed>&lt;!--Blocks based on user role--&gt;
            <redirect>true</redirect>&lt;!--Whether to redirect the user or simply show an error--&gt;
            <errormsg>You are not allowed to see this page.</errormsg>&lt;!--Show's the error to the user, either before or after redirecting.--&gt;
        </page>
        <page>
            <href>sales/delete</href>&lt;!--Single URI--&gt;
            <allowed>3</allowed>
            <redirect>true</redirect>
            <errormsg>You are not allowed to see this page.</errormsg>
        </page>
    </pages>
</acl>
—————————————————————————————————————————————————————————————----

Features:

Simple To Use
The ability to specify more than 1 link per rule. This enables you to block a larger number of URI's without the need to create an extremely large ACL.

No silly script initialization
Automatically checks whether the user has permission to view the current page.

XML ACL enables higher control over users
Powerful XML ACL
—————————————————————————————————————————————————————————————----

How To Use:
Simply move the files from the zip file to your CodeIgniter application directory. Making sure to change your cache_path in your CodeIgniter config.php file to match the new location of your acl.xml.


[LIBRARY] XACL(v:0.01a) - XML Access Control List - Enables simple ACL management with an XML ACL file - El Forum - 12-28-2009

[eluser]nedloh312[/eluser]
Reserved.


[LIBRARY] XACL(v:0.01a) - XML Access Control List - Enables simple ACL management with an XML ACL file - El Forum - 01-04-2010

[eluser]nedloh312[/eluser]
Any feedback?


[LIBRARY] XACL(v:0.01a) - XML Access Control List - Enables simple ACL management with an XML ACL file - El Forum - 01-05-2010

[eluser]carnalito[/eluser]
Why XML?

Regards


[LIBRARY] XACL(v:0.01a) - XML Access Control List - Enables simple ACL management with an XML ACL file - El Forum - 01-05-2010

[eluser]nedloh312[/eluser]
I chose XML as the storage file language becuase I think that XML is the way to go interms of flatfile storage. This also means no recursive calls to the database while building a normal menu. Also, XML is easy to update as PHP provides a range of classes for writing an XML file and CodeIgniter also has classes to turn an array into an xml object quite easily.

I plan on having the ability to cache the created array to save the time it would take to parse the XML file as parsing it every page load will take allot more resources than loading a cached file.