<commit_before><?php
class MenuEntry {
	private $title;
	private $link;
	private $identifier;
	private $permissions;
	private $children = array ();
	private $newWindow = false;
	public function __construct($title, $link, $identifier, $permissions = null, $children = array(), $newWindow = false) {
		$this->title = $title;
		$this->link = $link;
		$this->identifier = $identifier;
		$this->permissions = $permissions;
		$this->children = $children;
		$this->newWindow = $newWindow;
	}
	public function getTitle() {
		return $this->title;
	}
	public function getLink() {
		return $this->link;
	}
	public function getIdentifier() {
		return $this->identifier;
	}
	public function setTitle($value) {
		$this->title = $value;
	}
	public function setLink($value) {
		$this->link = $value;
	}
	public function setIdentifier($value) {
		$this->identifier = $value;
	}
	public function getChildren() {
		return $this->children;
	}
	public function setChildren($value) {
		$this->children = $value;
	}
	public function hasChildren() {
		return (count ( $this->children ) > 0);
	}
	public function addChild($children) {
		$this->children [] = $children;
	}
	public function getChildByID($identifier, $root = null) {
		$result = null;
		if (! $root) {
			$root = $this->children;
		}
		foreach ( $this->children as $root ) {
			if ($child->getIdentifier () == $identifier) {
				return $child;
			}
			if ($child->hasChildren ()) {
				return $this->getChildByID ( $identifier, $child );
			}
		}
		return null;
	}
	public function getPermissions() {
		return $this->permissions;
	}
	public function setPermissions($permissions) {
		$this->permissions = $permissions;
	}
	public function getNewWindow() {
		return $this->newWindow;
	}
	public function setNewWindow($val) {
		$this->newWindow = boolval ( $val );
	}
	public function userHasPermission() {
		$acl = new ACL ();
		if (is_string ( $this->permissions ) and ! empty ( $this->permissions )) {
			return $acl->hasPermission ( $this->permissions );
		} else if (is_array ( $this->permissions ) and count ( $this->permissions ) > 0) {
			foreach ( $this->permissions as $permission ) {
				$isPermitted = false;
				if (is_string ( $permission ) and ! empty ( $permission ) and $acl->hasPermission ( $permission )) {
					$isPermitted = true;
				}
			}
			return $isPermitted;
		} else {
			return true;
		}
	}
}<commit_msg>berechtigungsbug im menüsystem gefixt<commit_after><?php
class MenuEntry {
	private $title;
	private $link;
	private $identifier;
	private $permissions;
	private $children = array ();
	private $newWindow = false;
	public function __construct($title, $link, $identifier, $permissions = null, $children = array(), $newWindow = false) {
		$this->title = $title;
		$this->link = $link;
		$this->identifier = $identifier;
		$this->permissions = $permissions;
		$this->children = $children;
		$this->newWindow = $newWindow;
	}
	public function getTitle() {
		return $this->title;
	}
	public function getLink() {
		return $this->link;
	}
	public function getIdentifier() {
		return $this->identifier;
	}
	public function setTitle($value) {
		$this->title = $value;
	}
	public function setLink($value) {
		$this->link = $value;
	}
	public function setIdentifier($value) {
		$this->identifier = $value;
	}
	public function getChildren() {
		return $this->children;
	}
	public function setChildren($value) {
		$this->children = $value;
	}
	public function hasChildren() {
		return (count ( $this->children ) > 0);
	}
	public function addChild($children) {
		$this->children [] = $children;
	}
	public function getChildByID($identifier, $root = null) {
		$result = null;
		if (! $root) {
			$root = $this->children;
		}
		foreach ( $this->children as $root ) {
			if ($child->getIdentifier () == $identifier) {
				return $child;
			}
			if ($child->hasChildren ()) {
				return $this->getChildByID ( $identifier, $child );
			}
		}
		return null;
	}
	public function getPermissions() {
		return $this->permissions;
	}
	public function setPermissions($permissions) {
		$this->permissions = $permissions;
	}
	public function getNewWindow() {
		return $this->newWindow;
	}
	public function setNewWindow($val) {
		$this->newWindow = boolval ( $val );
	}
	public function userHasPermission() {
		$acl = new ACL ();
		if (is_string ( $this->permissions ) and ! empty ( $this->permissions )) {
			return $acl->hasPermission ( $this->permissions );
		} else if (is_array ( $this->permissions ) and count ( $this->permissions ) > 0) {
			$isPermitted = false;
			foreach ( $this->permissions as $permission ) {
				if (is_string ( $permission ) and ! empty ( $permission ) and $acl->hasPermission ( $permission )) {
					$isPermitted = true;
				}
			}
			return $isPermitted;
		} else {
			return true;
		}
	}
}
{'fraction_non_alphanumeric': 0.1549443627965568, 'fraction_numerical': 0.000839806844425782, 'mean_word_length': 3.846388606307223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 73, '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': '1361073', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1556, 'n_words': 375}