src/Entity/Organization.php
public function getPermissionsUserIds($type = null)
    {
        // if we have a user, grant him full access to all associated permissions.
        $user = $this->getUser();
        $spec = $user
            ? $spec = array(PermissionsInterface::PERMISSION_ALL => array($this->getUser()->getId()))
            : array();

        if (null === $type || ('Job/Permissions' != $type && 'Application' != $type)) {
            return $spec;
        }

        if ('Job/Permissions' == $type) {
            $change = EmployeePermissionsInterface::JOBS_CHANGE;
            $view   = EmployeePermissionsInterface::JOBS_VIEW;
        } else {
            $change = EmployeePermissionsInterface::APPLICATIONS_CHANGE;
            $view   = EmployeePermissionsInterface::APPLICATIONS_VIEW;
        }

        $employees = $this->isHiringOrganization()
            ? $this->getParent()->getEmployees()
            : $this->getEmployees();

        foreach ($employees as $emp) {
            /* @var $emp EmployeeInterface */
            if ($emp->isUnassigned()) {
                continue;
            }

            $perm = $emp->getPermissions();
            if ($perm->isAllowed($change)) {
                $spec[PermissionsInterface::PERMISSION_CHANGE][] = $emp->getUser()->getId();
            } elseif ($perm->isAllowed($view)) {
                $spec[PermissionsInterface::PERMISSION_VIEW][] = $emp->getUser()->getId();
            }
        }

        return $spec;
    }
public function getPermissionsUserIds($type = null)
    {
        // if we have a user, grant him full access to all associated permissions.
        $user = $this->getUser();
        $spec = $user
            ? $spec = array(PermissionsInterface::PERMISSION_ALL => array($this->getUser()->getId()))
            : array();

        if (null === $type || ('Job/Permissions' != $type && 'Application' != $type)) {
            return $spec;
        }

        if ('Job/Permissions' == $type) {
            $change = EmployeePermissionsInterface::JOBS_CHANGE;
            $view   = EmployeePermissionsInterface::JOBS_VIEW;
        } else {
            $change = EmployeePermissionsInterface::APPLICATIONS_CHANGE;
            $view   = EmployeePermissionsInterface::APPLICATIONS_VIEW;
        }

        $employees = $this->isHiringOrganization()
            ? $this->getParent()->getEmployees()
            : $this->getEmployees();

        foreach ($employees as $emp) {
            /* @var $emp EmployeeInterface */
            if ($emp->isUnassigned()) {
                continue;
            }

            $perm = $emp->getPermissions();
            if ($perm->isAllowed($change)) {
                $spec[PermissionsInterface::PERMISSION_CHANGE][] = $emp->getUser()->getId();
            } elseif ($perm->isAllowed($view)) {
                $spec[PermissionsInterface::PERMISSION_VIEW][] = $emp->getUser()->getId();
            }
        }

        return $spec;
    }
@param null $type

@return array