PHPackages                             anroots/db-acl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. anroots/db-acl

AbandonedArchivedKohana-module[Authentication &amp; Authorization](/categories/authentication)

anroots/db-acl
==============

Database-based ACL module for Kohana 3.3.

1.0.1(13y ago)181.1k4MITPHPPHP &gt;=5.4.0

Since Nov 15Pushed 13y ago5 watchersCompare

[ Source](https://github.com/anroots/kohana-db-acl)[ Packagist](https://packagist.org/packages/anroots/db-acl)[ Docs](https://github.com/anroots/kohana-db-acl)[ RSS](/packages/anroots-db-acl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Access Control Module for the Kohana Framework
==============================================

[](#access-control-module-for-the-kohana-framework)

Database-based ACL module for Kohana 3.3 / PHP 5.4. Users get authorization to perform certain actions through their roles. Each role can have several permissions. You define new roles and permissions in the database as you see fit.

I actually do recommend against using this module unless you specifically want the role/permission management to happen in the database (some projects need permissions managed from the GUI, by administrative users). For an alternative (and much better) implementation, see .

Dependencies
============

[](#dependencies)

1. PHP &gt;= 5.4
2. Kohana &gt;= 3.3
3. Default Database, Auth and ORM modules

Usage
=====

[](#usage)

```
// ...
public function save_customer() {
	$current_user = Auth::instance()->get_user();

	if (!$current_user->can(Permission::EDIT_CUSTOMERS)) {
		throw new Authorization_Exception();
	}

	// Save the Customer ORM model
	$this->save();
}
// ...
```

Defining permissions
--------------------

[](#defining-permissions)

Create new entries in the `permissions` table as you develop your application. Associate permissions with roles and check for the user's authorization to perform some action in your code.

### Permission constants

[](#permission-constants)

Override `Permission` in your `APPPATH` to define permission constants. Constant values correspond to the `id` column of the `permissions` table.

```
