src/Acl/WriteAssertion.php
protected function checkOrganizationPermissions($role, $resource)
    {
        /* @var $resource \Jobs\Entity\JobInterface */
        /* @var $role     \Auth\Entity\UserInterface */
        $organization = $resource->getOrganization();
        if (!$organization) {
            return false;
        }

        if ($organization->isHiringOrganization()) {
            $organization = $organization->getParent();
        }

        $orgUser = $organization->getUser();

        if ($orgUser && $role->getId() == $orgUser->getId()) {
            return true;
        }

        $employees = $organization->getEmployees();

        foreach ($employees as $emp) {
            /* @var $emp \Organizations\Entity\EmployeeInterface */
            if ($emp->getUser()->getId() == $role->getId()
                && $emp->getPermissions()->isAllowed(EmployeePermissionsInterface::JOBS_CHANGE)
            ) {
                return true;
            }
        }

        return false;
    }
protected function checkOrganizationPermissions($role, $resource)
    {
        /* @var $resource \Jobs\Entity\JobInterface */
        /* @var $role     \Auth\Entity\UserInterface */
        $organization = $resource->getOrganization();
        if (!$organization) {
            return false;
        }

        if ($organization->isHiringOrganization()) {
            $organization = $organization->getParent();
        }

        $orgUser = $organization->getUser();

        if ($orgUser && $role->getId() == $orgUser->getId()) {
            return true;
        }

        $employees = $organization->getEmployees();

        foreach ($employees as $emp) {
            /* @var $emp \Organizations\Entity\EmployeeInterface */
            if ($emp->getUser()->getId() == $role->getId()
                && $emp->getPermissions()->isAllowed(EmployeePermissionsInterface::JOBS_CHANGE)
            ) {
                return true;
            }
        }

        return false;
    }
protected function checkOrganizationPermissions ( $ role , $ resource ) { /* @var $resource \Jobs\Entity\JobInterface */ /* @var $role     \Auth\Entity\UserInterface */ $ organization = $ resource -> getOrganization ( ) ; if ( ! $ organization ) { return false ; } if ( $ organization -> isHiringOrganization ( ) ) { $ organization = $ organization -> getParent ( ) ; } $ orgUser = $ organization -> getUser ( ) ; if ( $ orgUser && $ role -> getId ( ) == $ orgUser -> getId ( ) ) { return true ; } $ employees = $ organization -> getEmployees ( ) ; foreach ( $ employees as $ emp ) { /* @var $emp \Organizations\Entity\EmployeeInterface */ if ( $ emp -> getUser ( ) -> getId ( ) == $ role -> getId ( ) && $ emp -> getPermissions ( ) -> isAllowed ( EmployeePermissionsInterface :: JOBS_CHANGE ) ) { return true ; } } return false ; }
Returns true, if the user has write access to the job granted from the organization.

@param RoleInterface $role This must be a UserInterface instance
@param ResourceInterface $resource This must be a JobInterface instance

@return bool
Returns true if the user has write access to the job granted from the organization .