Welcome Guest, Not a member yet? Register   Sign In
Khaos :: KhACL
#1

[eluser]Neophyte[/eluser]
Updated - 31/03/2008 - Download - Khaos::KhACL - 0.1-alpha5

Introduction
If you are looking for a fast, easy to use and quick to install user auth library then this library is not for you. If how ever you have an existing user auth library or are looking to develop your own and need extremely fine grained control over your users actions then this library may be what you are looking for.

KhACL takes a very traditional approach to ACL akin to the phpgacl script where you have a core ACL class which manages ARO, ACO and AXO objects. Obviously discussing the background of this approach and how it all works is way beyond the scope of a forum post so im just going to give a basic run down of the main methods available for use within the library. - edit - as sophistry pointed out below the The phpgACL manual gives a reasonable overview.

Quick Reference
Code:
/*
* Helper
* -------
* bool kh_acl_check  ( string $aro, string $aco [, string $axo ] )
*
* Library
* -------
* KhACL
* bool allow  ( string $aro, string $aco [, string $axo ] )
* bool deny  ( string $aro, string $aco [, string $axo ] )
* bool check  ( string $aro, string $aco [, string $axo ] )
*
* KhACL->ARO
* bool create ( string $aro [, string $aro_parent [, int $link ]] )
* bool delete ( string $aro )
*
* KhACL->ACO
* bool create ( string $aco [, string $aco_parent [, int $link ]] )
* bool delete ( string $aco )
*
* KhACL->AXO
* bool create ( string $axo )
* bool delete ( string $axo )
*/

// Helper Examples
$allowed = kh_acl_check('neophyte', 'news', 'comment');

// Library Examples - KhACL
$this->khacl->allow('editors', 'news', 'publish');
$this->khacl->deny('anonymous', 'news', 'comment');
$allowed = $this->khacl->check('neophyte', 'news', 'comment');

// Library Examples - KhACL->ARO
$this->khacl->aro->create('neophyte', 'editors');
$this->khacl->aro->delete('neophyte');

// Library Examples - KhACL->ACO
$this->khacl->aco->create('news', 'modules');
$this->khacl->aco->delete('news');

// Examples - KhACL->AXO
$this->khacl->axo->create('publish');
$this->khacl->axo->delete('publish');
General Usage - Typically you should only add the helper to autoload for general page requests manually loading the library as and when you need to modify the ACL, this is to make checks as fast as possible.

AXO objects - As with phpgacl are completely optional however they are stored as a simple list so you cannot build up tree heirarchies of AXO objects like you can with the ARO and ACO objects (through use of a modified preorder tree traversal table schema). Personally i have never needed tree based heirarchies for the AXO objects even when i have needed extremely fine levels of control however if this did end up being a requested feature i could code it in.

Links - The link argument you see when creating ARO or ACO objects as you can see is completely optional and an idea i stole from cakephp which i think may come in handy for some people (myself included) where you can specify an ID to what this represents in your own database (such as a user_id) so if you wish to perform your own SQL queries you can join the relevent records.

Optional Dependencies
>= KhCache-0.3
If detected this will allow khacl to cache check results greatly increasing the speed of checks.


Messages In This Thread
Khaos :: KhACL - by El Forum - 01-29-2008, 10:49 AM
Khaos :: KhACL - by El Forum - 01-29-2008, 11:42 AM
Khaos :: KhACL - by El Forum - 01-29-2008, 12:35 PM
Khaos :: KhACL - by El Forum - 01-30-2008, 07:10 AM
Khaos :: KhACL - by El Forum - 01-30-2008, 05:11 PM
Khaos :: KhACL - by El Forum - 01-30-2008, 08:17 PM
Khaos :: KhACL - by El Forum - 01-31-2008, 03:49 AM
Khaos :: KhACL - by El Forum - 01-31-2008, 09:14 AM
Khaos :: KhACL - by El Forum - 01-31-2008, 10:03 AM
Khaos :: KhACL - by El Forum - 01-31-2008, 10:33 AM
Khaos :: KhACL - by El Forum - 01-31-2008, 10:39 AM
Khaos :: KhACL - by El Forum - 01-31-2008, 10:50 AM
Khaos :: KhACL - by El Forum - 01-31-2008, 03:14 PM
Khaos :: KhACL - by El Forum - 02-03-2008, 11:00 AM
Khaos :: KhACL - by El Forum - 02-03-2008, 01:35 PM
Khaos :: KhACL - by El Forum - 02-04-2008, 12:22 PM
Khaos :: KhACL - by El Forum - 02-05-2008, 03:45 AM
Khaos :: KhACL - by El Forum - 02-25-2008, 12:42 PM
Khaos :: KhACL - by El Forum - 02-25-2008, 01:16 PM
Khaos :: KhACL - by El Forum - 02-25-2008, 02:53 PM
Khaos :: KhACL - by El Forum - 02-25-2008, 02:59 PM
Khaos :: KhACL - by El Forum - 02-25-2008, 03:55 PM
Khaos :: KhACL - by El Forum - 02-25-2008, 04:03 PM
Khaos :: KhACL - by El Forum - 02-29-2008, 09:56 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 06:23 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 07:03 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 07:28 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 07:34 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 07:44 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 08:05 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 08:20 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 09:06 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 09:12 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 09:19 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 09:26 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 09:46 AM
Khaos :: KhACL - by El Forum - 03-02-2008, 10:47 AM
Khaos :: KhACL - by El Forum - 03-08-2008, 05:37 PM
Khaos :: KhACL - by El Forum - 03-09-2008, 10:22 AM
Khaos :: KhACL - by El Forum - 03-09-2008, 10:24 AM
Khaos :: KhACL - by El Forum - 03-09-2008, 12:21 PM
Khaos :: KhACL - by El Forum - 03-20-2008, 05:25 AM
Khaos :: KhACL - by El Forum - 03-20-2008, 06:14 AM
Khaos :: KhACL - by El Forum - 03-20-2008, 07:08 AM
Khaos :: KhACL - by El Forum - 03-20-2008, 07:42 AM
Khaos :: KhACL - by El Forum - 03-20-2008, 11:31 AM
Khaos :: KhACL - by El Forum - 03-20-2008, 11:40 AM
Khaos :: KhACL - by El Forum - 03-21-2008, 05:16 AM
Khaos :: KhACL - by El Forum - 03-21-2008, 05:25 AM
Khaos :: KhACL - by El Forum - 03-21-2008, 07:54 AM
Khaos :: KhACL - by El Forum - 03-21-2008, 08:31 AM
Khaos :: KhACL - by El Forum - 03-21-2008, 12:35 PM
Khaos :: KhACL - by El Forum - 03-21-2008, 12:38 PM
Khaos :: KhACL - by El Forum - 03-21-2008, 01:28 PM
Khaos :: KhACL - by El Forum - 03-21-2008, 01:33 PM
Khaos :: KhACL - by El Forum - 03-21-2008, 03:18 PM
Khaos :: KhACL - by El Forum - 03-21-2008, 06:37 PM
Khaos :: KhACL - by El Forum - 03-26-2008, 05:13 AM
Khaos :: KhACL - by El Forum - 03-28-2008, 02:16 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 02:17 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 04:07 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 04:26 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 05:32 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 06:28 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 09:36 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 10:23 AM
Khaos :: KhACL - by El Forum - 03-30-2008, 10:25 PM
Khaos :: KhACL - by El Forum - 03-31-2008, 02:59 AM
Khaos :: KhACL - by El Forum - 03-31-2008, 03:20 AM
Khaos :: KhACL - by El Forum - 03-31-2008, 06:43 AM
Khaos :: KhACL - by El Forum - 04-11-2008, 11:33 AM
Khaos :: KhACL - by El Forum - 04-11-2008, 11:48 AM
Khaos :: KhACL - by El Forum - 04-12-2008, 02:17 AM
Khaos :: KhACL - by El Forum - 04-14-2008, 02:32 AM
Khaos :: KhACL - by El Forum - 04-14-2008, 11:11 AM
Khaos :: KhACL - by El Forum - 05-02-2008, 01:04 AM
Khaos :: KhACL - by El Forum - 05-02-2008, 02:05 AM
Khaos :: KhACL - by El Forum - 05-19-2008, 05:01 PM
Khaos :: KhACL - by El Forum - 05-19-2008, 05:31 PM
Khaos :: KhACL - by El Forum - 05-19-2008, 05:40 PM
Khaos :: KhACL - by El Forum - 06-09-2008, 10:26 AM
Khaos :: KhACL - by El Forum - 06-17-2008, 02:31 PM
Khaos :: KhACL - by El Forum - 06-17-2008, 02:33 PM
Khaos :: KhACL - by El Forum - 06-25-2008, 09:43 AM
Khaos :: KhACL - by El Forum - 06-25-2008, 09:44 AM
Khaos :: KhACL - by El Forum - 06-26-2008, 06:54 AM
Khaos :: KhACL - by El Forum - 07-24-2008, 11:29 PM
Khaos :: KhACL - by El Forum - 07-27-2008, 06:06 PM
Khaos :: KhACL - by El Forum - 09-09-2008, 03:51 PM
Khaos :: KhACL - by El Forum - 05-06-2009, 03:18 AM
Khaos :: KhACL - by El Forum - 06-16-2009, 03:35 AM
Khaos :: KhACL - by El Forum - 07-24-2009, 12:48 AM
Khaos :: KhACL - by El Forum - 11-02-2010, 06:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB