public function getParent($permission) {
        $permission = $this->cast($permission);

        foreach ($this->toArray() as $element) {
            if (Permission::ENTITY === $element->getType() && 0 === strpos($permission->getValue(), $element->getValue())) {
                return $element;
            }
        }
    }