<commit_before>package main

import (
	"fmt"
	"net/http"
	"strings"

	"github.com/gin-gonic/gin"
	"github.com/xyproto/permissions"
)

func main() {
	g := gin.New()

	// New permissions middleware
	perm := permissions.New()

	// Set up a middleware handler for Gin, with a custom "permission denied" message.
	permissionHandler := func(c *gin.Context) {
		// Check if the user has the right admin/user rights
		if perm.Rejected(c.Writer, c.Request) {
			fmt.Fprint(c.Writer, "Permission denied!")
			// Deny the request, don't call other middleware handlers
			c.Abort(http.StatusForbidden)<commit_msg>Fix [GIN] WARNING. Headers were already written!<commit_after>package main

import (
	"fmt"
	"net/http"
	"strings"

	"github.com/gin-gonic/gin"
	"github.com/xyproto/permissions"
)

func main() {
	g := gin.New()

	// New permissions middleware
	perm := permissions.New()

	// Set up a middleware handler for Gin, with a custom "permission denied" message.
	permissionHandler := func(c *gin.Context) {
		// Check if the user has the right admin/user rights
		if perm.Rejected(c.Writer, c.Request) {
			// Deny the request, don't call other middleware handlers
			c.Abort(http.StatusForbidden)
			fmt.Fprint(c.Writer, "Permission denied!")
{'fraction_non_alphanumeric': 0.12772837510105092, 'fraction_numerical': 0.0, 'mean_word_length': 3.8359375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7350363', 'n_tokens_mistral': 443, 'n_tokens_neox': 413, 'n_words': 119}