src/Permissions/ACL.php
public function inherit($roles, $inherits) {

		if(true === is_string($roles)) {
			$roles = [$roles];
		}

		if(true === is_string($inherits)) {
			$inherits = [$inherits];
		}

		if(false === is_array($roles)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($roles)), E_USER_ERROR);
		}

		if(false === is_array($inherits)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($inherits)), E_USER_ERROR);
		}

		foreach($inherits as $inherit) {

			if(true === isset($this -> permissions[$inherit])) {

				foreach($this -> permissions[$inherit] as $resource => $allowed) {

					foreach($roles as $role) {
						$this -> fill($role, $resource, $allowed);
					}
				}

			}
		}

		return $this; 
	}
public function inherit($roles, $inherits) {

		if(true === is_string($roles)) {
			$roles = [$roles];
		}

		if(true === is_string($inherits)) {
			$inherits = [$inherits];
		}

		if(false === is_array($roles)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($roles)), E_USER_ERROR);
		}

		if(false === is_array($inherits)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($inherits)), E_USER_ERROR);
		}

		foreach($inherits as $inherit) {

			if(true === isset($this -> permissions[$inherit])) {

				foreach($this -> permissions[$inherit] as $resource => $allowed) {

					foreach($roles as $role) {
						$this -> fill($role, $resource, $allowed);
					}
				}

			}
		}

		return $this; 
	}
public function inherit ( $ roles , $ inherits ) { if ( true === is_string ( $ roles ) ) { $ roles = [ $ roles ] ; } if ( true === is_string ( $ inherits ) ) { $ inherits = [ $ inherits ] ; } if ( false === is_array ( $ roles ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string or array, "%s" given' , __METHOD__ , gettype ( $ roles ) ) , E_USER_ERROR ) ; } if ( false === is_array ( $ inherits ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string or array, "%s" given' , __METHOD__ , gettype ( $ inherits ) ) , E_USER_ERROR ) ; } foreach ( $ inherits as $ inherit ) { if ( true === isset ( $ this -> permissions [ $ inherit ] ) ) { foreach ( $ this -> permissions [ $ inherit ] as $ resource => $ allowed ) { foreach ( $ roles as $ role ) { $ this -> fill ( $ role , $ resource , $ allowed ) ; } } } } return $ this ; }
Let a single or multiple roles inherit the resources of other single or multiple roles
@param string|array $roles
@param string|array $inherits
@return sFire\Permissions\ACL
Let a single or multiple roles inherit the resources of other single or multiple roles