protected function checkPermission(array $prepared, $permission)
    {
        if (array_key_exists($permission, $prepared) && $prepared[$permission] === true) {
            return true;
        }

        $permission = (string) $permission;

        foreach ($prepared as $key => $value) {
            $key = (string) $key;

            if ((str_is($permission, $key) || str_is($key, $permission)) && $value === true) {
                return true;
            }
        }

        return false;
    }
protected function checkPermission(array $prepared, $permission)
    {
        if (array_key_exists($permission, $prepared) && $prepared[$permission] === true) {
            return true;
        }

        $permission = (string) $permission;

        foreach ($prepared as $key => $value) {
            $key = (string) $key;

            if ((str_is($permission, $key) || str_is($key, $permission)) && $value === true) {
                return true;
            }
        }

        return false;
    }
protected function checkPermission ( array $ prepared , $ permission ) { if ( array_key_exists ( $ permission , $ prepared ) && $ prepared [ $ permission ] === true ) { return true ; } $ permission = ( string ) $ permission ; foreach ( $ prepared as $ key => $ value ) { $ key = ( string ) $ key ; if ( ( str_is ( $ permission , $ key ) || str_is ( $ key , $ permission ) ) && $ value === true ) { return true ; } } return false ; }
Checks a permission in the prepared array, including wildcard checks and permissions.

@param  array  $prepared
@param  string  $permission
@return bool
Checks a permission in the prepared array including wildcard checks and permissions .