Sharing/SharingManager.php
private function doLoadSharingPermissions(array $idSubjects, array $roles): void
    {
        /** @var RoleInterface[] $mapRoles */
        $mapRoles = [];
        $cRoles = $this->provider->getPermissionRoles($roles);

        foreach ($cRoles as $role) {
            $mapRoles[$role->getName()] = $role;
        }

        /** @var SubjectIdentityInterface $subject */
        foreach ($idSubjects as $id => $subject) {
            foreach ($this->cacheRoleSharing[$id] as $roleId) {
                if (isset($mapRoles[$roleId])) {
                    $cRole = $mapRoles[$roleId];

                    foreach ($cRole->getPermissions() as $perm) {
                        $class = $subject->getType();
                        $field = PermissionUtils::getMapAction($perm->getField());
                        $this->cacheSharing[$id][$class][$field][$perm->getOperation()] = true;
                    }
                }
            }
        }
    }
private function doLoadSharingPermissions(array $idSubjects, array $roles): void
    {
        /** @var RoleInterface[] $mapRoles */
        $mapRoles = [];
        $cRoles = $this->provider->getPermissionRoles($roles);

        foreach ($cRoles as $role) {
            $mapRoles[$role->getName()] = $role;
        }

        /** @var SubjectIdentityInterface $subject */
        foreach ($idSubjects as $id => $subject) {
            foreach ($this->cacheRoleSharing[$id] as $roleId) {
                if (isset($mapRoles[$roleId])) {
                    $cRole = $mapRoles[$roleId];

                    foreach ($cRole->getPermissions() as $perm) {
                        $class = $subject->getType();
                        $field = PermissionUtils::getMapAction($perm->getField());
                        $this->cacheSharing[$id][$class][$field][$perm->getOperation()] = true;
                    }
                }
            }
        }
    }
private function doLoadSharingPermissions ( array $ idSubjects , array $ roles ) : void { /** @var RoleInterface[] $mapRoles */ $ mapRoles = [ ] ; $ cRoles = $ this -> provider -> getPermissionRoles ( $ roles ) ; foreach ( $ cRoles as $ role ) { $ mapRoles [ $ role -> getName ( ) ] = $ role ; } /** @var SubjectIdentityInterface $subject */ foreach ( $ idSubjects as $ id => $ subject ) { foreach ( $ this -> cacheRoleSharing [ $ id ] as $ roleId ) { if ( isset ( $ mapRoles [ $ roleId ] ) ) { $ cRole = $ mapRoles [ $ roleId ] ; foreach ( $ cRole -> getPermissions ( ) as $ perm ) { $ class = $ subject -> getType ( ) ; $ field = PermissionUtils :: getMapAction ( $ perm -> getField ( ) ) ; $ this -> cacheSharing [ $ id ] [ $ class ] [ $ field ] [ $ perm -> getOperation ( ) ] = true ; } } } } }
Action to load the permissions of sharing roles.

@param array    $idSubjects The map of subject id and subject
@param string[] $roles      The roles
Action to load the permissions of sharing roles .