code: 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;
              }
          }
      }
docs: Get parent permission
  
  @param \Ds\Component\Acl\Model\Permission $permission
  @return \Ds\Component\Acl\Model\Permission