<commit_before><?php namespace Orchestra\Story\Routing\Api;

use Illuminate\Support\Facades\View;
use Orchestra\Support\Facades\Acl;
use Orchestra\Support\Facades\Site;

class WriterController extends EditorController {

	/**
	 * Define filter for the controller.
	 *
	 * @access public
	 * @return void
	 */
	public function __construct()
	{
		parent::__construct();

		$acl = Acl::make('orchestra/story');

		$this->beforeFilter(function () use ($acl)
		{
			if ( ! ($acl->can('create post') or $acl->can('manage post')))
			{
				return resources('/');
			}
		});
	}

	/**
	 * Write a post page.<commit_msg>Propertly redirect if filter failed.<commit_after><?php namespace Orchestra\Story\Routing\Api;

use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
use Orchestra\Support\Facades\Acl;
use Orchestra\Support\Facades\Site;

class WriterController extends EditorController {

	/**
	 * Define filter for the controller.
	 *
	 * @access public
	 * @return void
	 */
	public function __construct()
	{
		parent::__construct();

		$acl = Acl::make('orchestra/story');

		$this->beforeFilter(function () use ($acl)
		{
			if ( ! ($acl->can('create post') or $acl->can('manage post')))
			{
				return Redirect::to(resources('/'));
			}
		});
	}

	/**
	 * Write a post page.
{'fraction_non_alphanumeric': 0.15793528505392912, 'fraction_numerical': 0.0, 'mean_word_length': 3.828996282527881, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3516688', 'n_tokens_mistral': 448, 'n_tokens_neox': 407, 'n_words': 91}