Skip to content

Commit

Permalink
Merge pull request #2 from phalcon/master
Browse files Browse the repository at this point in the history
Merge phalcon-devtools
  • Loading branch information
dreamsxin committed Oct 29, 2013
2 parents a3456d8 + 657bb6e commit 196073b
Show file tree
Hide file tree
Showing 559 changed files with 56,108 additions and 3,566 deletions.
5 changes: 5 additions & 0 deletions composer.json
Expand Up @@ -13,5 +13,10 @@
],
"require": {
"php": ">=5.3.6"
},
"autoload": {
"psr-0" : {
"Phalcon" : "scripts/"
}
}
}
55 changes: 55 additions & 0 deletions ide/1.2.3/Phalcon/Acl.php
@@ -0,0 +1,55 @@
<?php

namespace Phalcon {

/**
* Phalcon\Acl
*
* This component allows to manage ACL lists. An access control list (ACL) is a list
* of permissions attached to an object. An ACL specifies which users or system processes
* are granted access to objects, as well as what operations are allowed on given objects.
*
*<code>
*
* $acl = new Phalcon\Acl\Adapter\Memory();
*
* //Default action is deny access
* $acl->setDefaultAction(Phalcon\Acl::DENY);
*
* //Create some roles
* $roleAdmins = new Phalcon\Acl\Role('Administrators', 'Super-User role');
* $roleGuests = new Phalcon\Acl\Role('Guests');
*
* //Add "Guests" role to acl
* $acl->addRole($roleGuests);
*
* //Add "Designers" role to acl
* $acl->addRole('Designers');
*
* //Define the "Customers" resource
* $customersResource = new Phalcon\Acl\Resource('Customers', 'Customers management');
*
* //Add "customers" resource with a couple of operations
* $acl->addResource($customersResource, 'search');
* $acl->addResource($customersResource, array('create', 'update'));
*
* //Set access level for roles into resources
* $acl->allow('Guests', 'Customers', 'search');
* $acl->allow('Guests', 'Customers', 'create');
* $acl->deny('Guests', 'Customers', 'update');
*
* //Check whether role has access to the operations
* $acl->isAllowed('Guests', 'Customers', 'edit'); //Returns 0
* $acl->isAllowed('Guests', 'Customers', 'search'); //Returns 1
* $acl->isAllowed('Guests', 'Customers', 'create'); //Returns 1
*
*</code>
*/

abstract class Acl {

const ALLOW = 1;

const DENY = 0;
}
}
81 changes: 81 additions & 0 deletions ide/1.2.3/Phalcon/Acl/Adapter.php
@@ -0,0 +1,81 @@
<?php

namespace Phalcon\Acl {

/**
* Phalcon\Acl\Adapter
*
* Adapter for Phalcon\Acl adapters
*/

abstract class Adapter implements \Phalcon\Events\EventsAwareInterface {

protected $_eventsManager;

protected $_defaultAccess;

protected $_accessGranted;

protected $_activeRole;

protected $_activeResource;

protected $_activeAccess;

/**
* Sets the events manager
*
* @param \Phalcon\Events\ManagerInterface $eventsManager
*/
public function setEventsManager($eventsManager){ }


/**
* Returns the internal event manager
*
* @return \Phalcon\Events\ManagerInterface
*/
public function getEventsManager(){ }


/**
* Sets the default access level (Phalcon\Acl::ALLOW or \Phalcon\Acl::DENY)
*
* @param int $defaultAccess
*/
public function setDefaultAction($defaultAccess){ }


/**
* Returns the default ACL access level
*
* @return int
*/
public function getDefaultAction(){ }


/**
* Returns the role which the list is checking if it's allowed to certain resource/access
*
* @return string
*/
public function getActiveRole(){ }


/**
* Returns the resource which the list is checking if some role can access it
*
* @return string
*/
public function getActiveResource(){ }


/**
* Returns the access which the list is checking if some role can access it
*
* @return string
*/
public function getActiveAccess(){ }

}
}

0 comments on commit 196073b

Please sign in to comment.