<commit_before><?php

/**
* @package   s9e\Toolkit
* @copyright Copyright (c) 2010 The s9e Authors
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace s9e\Toolkit\Acl;

class Acl
{
	protected $settings = array();
	protected $rules = array(
		'grant'   => array(),
		'require' => array()
	);

	protected $parents = array();

	protected $children = array();

	/**
	* @var Reader
	*/
	protected $reader;

	const ALLOW = 1;
	const DENY  = 0;

	public function allow($perm, $scope = array())
	{
		return $this->add(self::ALLOW, $perm, $scope);
	}

	public function deny($perm, $scope = array())
	{
		return $this->add(self::DENY, $perm, $scope);
	}

	public function addRule($perm, $rule, $foreignPerm)
	{
		/**<commit_msg>Added some relatively useless phpdoc stuff<commit_after><?php

/**
* @package   s9e\Toolkit
* @copyright Copyright (c) 2010 The s9e Authors
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace s9e\Toolkit\Acl;

class Acl
{
	/**
	* @var array List of settings directly associated with this ACL 
	*/
	protected $settings = array();

	/**
	* @var array List of rules directly associated with this ACL 
	*/
	protected $rules = array(
		'grant'   => array(),
		'require' => array()
	);

	/**
	* @var array List of instances of Acl that this ACL inherits from
	*/
	protected $parents = array();

	/**
	* @var array List of instances of Acl that inherit from this
	*/
	protected $children = array();

	/**
	* @var Reader
	*/
	protected $reader;

	const ALLOW = 1;
	const DENY  = 0;

	/**
	* Grant a permission in given scope
	*
	* This method is chainable.
	*
	* @param  string $perm  Permission name
	* @param  array  $scope Permission scope
	* @return Acl           $this
	*/
	public function allow($perm, $scope = array())
	{
		return $this->add(self::ALLOW, $perm, $scope);
	}

	/**
	* Deny a permission in given scope
	*
	* This method is chainable.
	*
	* @param  string $perm  Permission name
	* @param  array  $scope Permission scope
	* @return Acl           $this
	*/
	public function deny($perm, $scope = array())
	{
		return $this->add(self::DENY, $perm, $scope);
	}

	/**
	* Add a rule
	*
	* This method is chainable.
	*
	* @param  string $perm         Permission name
	* @param  string $rule         Rule name: either "grant" or "require"
	* @param  string $foreignPerm  Permission name
	* @return Acl                  $this
	*/
	public function addRule($perm, $rule, $foreignPerm)
	{
		/**
{'fraction_non_alphanumeric': 0.14394546912590217, 'fraction_numerical': 0.007217321571772253, 'mean_word_length': 3.151414309484193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7164860', 'n_tokens_mistral': 901, 'n_tokens_neox': 840, 'n_words': 259}