Fixing proper namespace for app/library
This commit is contained in:
parent
cb1e40ee0a
commit
aa37d10024
22 changed files with 78 additions and 62 deletions
|
|
@ -1,18 +1,19 @@
|
|||
<?php
|
||||
|
||||
use Phalcon\Acl;
|
||||
use Phalcon\Events\Event;
|
||||
use Phalcon\Mvc\Dispatcher;
|
||||
|
||||
use Httpcb\Acl;
|
||||
|
||||
class AclPlugin extends Phalcon\Mvc\User\Plugin
|
||||
{
|
||||
public function beforeExecuteRoute(Event $event, Dispatcher $dispatcher)
|
||||
{
|
||||
// We only have two roles for now, authenticated users and guests.
|
||||
if ($this->auth->hasIdentity()) {
|
||||
$role = \Acl\Acl::ROLE_USER;
|
||||
$role = Acl::ROLE_USER;
|
||||
} else {
|
||||
$role = \Acl\Acl::ROLE_GUEST;
|
||||
$role = Acl::ROLE_GUEST;
|
||||
}
|
||||
|
||||
// Support annotations for actions to define custom resources.
|
||||
|
|
@ -32,7 +33,7 @@ class AclPlugin extends Phalcon\Mvc\User\Plugin
|
|||
|
||||
// Now, check and redirect user to login page if
|
||||
// this role does not have access to this resource.
|
||||
if ($this->acl->isAllowed($role, $resource, 'Read') == Acl::DENY) {
|
||||
if ($this->acl->isAllowed($role, $resource, 'Read') == \Phalcon\Acl::DENY) {
|
||||
|
||||
// Forward to login page.
|
||||
$dispatcher->forward(array(
|
||||
|
|
|
|||
Reference in a new issue