Created
February 3, 2012 14:53
-
-
Save gautamk/1730532 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Test extends Controller { | |
function Test() { | |
parent::Controller() | |
$this->load->library('Acl'); | |
define('ROLE', '1'); | |
define('RESOURCE', '1'); | |
} | |
function index() { | |
if (!$this->acl->can_read(ROLE, RESOURCE)) { | |
die("You do not have permissions to read this resource"); | |
} | |
echo "You have permission to read this resource!"; | |
} | |
function write() { | |
if (!$this->acl->can_write(ROLE, RESOURCE)) { | |
die("You do not have permissions to write to this resource"); | |
} | |
echo "You have permission to write to this resource!"; | |
} | |
function modify() { | |
if (!$this->acl->can_modify(ROLE, RESOURCE)) { | |
die("You do not have permissions to modify this resource"); | |
} | |
echo "You have permission to modify this resource!"; | |
} | |
function delete() { | |
if (!$this->acl->can_delete(ROLE, RESOURCE)) { | |
die("You do not have permissions to delete this resource"); | |
} | |
echo "You have permission to delete this resource!"; | |
} | |
function publish() { | |
if (!$this->acl->can_publish(ROLE, RESOURCE)) { | |
die("You do not have permissions to publish this resource"); | |
} | |
echo "You have permission to publish this resource!"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment