<commit_before><?php

Route::filter('basicAuth', function()
{
    if(!Sentry::check()) 
    {
        return Redirect::route('getLogin');
    }

    View::share('currentUser', Sentry::getUser());
});

Route::filter('notAuth', function()
{
    if(Sentry::check())
    {
        return Redirect::route('indexDashboard');
    }
});

Route::filter('hasPermissions', function()
{
    $permissions = Config::get('syntara::permissions');

    if(!Sentry::getUser()->hasAccess($permissions[Route::currentRouteName()]))
    {
        return Redirect::route('accessDenied');
    }
});<commit_msg>Allow users to edit their own record<commit_after><?php

Route::filter('basicAuth', function()
{
    if(!Sentry::check())
    {
        return Redirect::route('getLogin');
    }

    View::share('currentUser', Sentry::getUser());
});

Route::filter('notAuth', function()
{
    if(Sentry::check())
    {
        return Redirect::route('indexDashboard');
    }
});

Route::filter('hasPermissions', function()
{
    $permissions = Config::get('syntara::permissions');

    if (Route::currentRouteName() == "putUser" && Sentry::getUser()->id == Request::segment(3) ||
        Route::currentRouteName() == "showUser" && Sentry::getUser()->id == Request::segment(3)) {

    } else {
        if(!Sentry::getUser()->hasAccess($permissions[Route::currentRouteName()]))
        {
            return Redirect::route('accessDenied');
        }
    }
});
{'fraction_non_alphanumeric': 0.20742817098808689, 'fraction_numerical': 0.001401541695865452, 'mean_word_length': 4.1, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2173352', 'n_tokens_mistral': 441, 'n_tokens_neox': 440, 'n_words': 56}