src/Auth/AclRepository.php
protected function collapsePermissions()
    {
        foreach ($this->modulePresences as $moduleKey => $presences) {

            if ( ! array_key_exists($moduleKey, $this->modulePermissions)) {
                $this->modulePermissions[ $moduleKey ] = [];
            }

            /** @var AclPresenceInterface[] $presences */
            foreach ($presences as $presence) {

                if ( ! count($presence->permissions())) {
                    continue;
                }

                $flatPermissions = $presence->permissions();

                $this->permissions                   = array_merge($this->permissions, $flatPermissions);
                $this->modulePermissions[$moduleKey] = array_merge($this->modulePermissions[$moduleKey], $flatPermissions);
            }
        }

        $this->permissions = array_unique($this->permissions);

        return $this;
    }
protected function collapsePermissions()
    {
        foreach ($this->modulePresences as $moduleKey => $presences) {

            if ( ! array_key_exists($moduleKey, $this->modulePermissions)) {
                $this->modulePermissions[ $moduleKey ] = [];
            }

            /** @var AclPresenceInterface[] $presences */
            foreach ($presences as $presence) {

                if ( ! count($presence->permissions())) {
                    continue;
                }

                $flatPermissions = $presence->permissions();

                $this->permissions                   = array_merge($this->permissions, $flatPermissions);
                $this->modulePermissions[$moduleKey] = array_merge($this->modulePermissions[$moduleKey], $flatPermissions);
            }
        }

        $this->permissions = array_unique($this->permissions);

        return $this;
    }
protected function collapsePermissions ( ) { foreach ( $ this -> modulePresences as $ moduleKey => $ presences ) { if ( ! array_key_exists ( $ moduleKey , $ this -> modulePermissions ) ) { $ this -> modulePermissions [ $ moduleKey ] = [ ] ; } /** @var AclPresenceInterface[] $presences */ foreach ( $ presences as $ presence ) { if ( ! count ( $ presence -> permissions ( ) ) ) { continue ; } $ flatPermissions = $ presence -> permissions ( ) ; $ this -> permissions = array_merge ( $ this -> permissions , $ flatPermissions ) ; $ this -> modulePermissions [ $ moduleKey ] = array_merge ( $ this -> modulePermissions [ $ moduleKey ] , $ flatPermissions ) ; } } $ this -> permissions = array_unique ( $ this -> permissions ) ; return $ this ; }
Collapses all permissions from presences into flat permission arrays.

@return $this
Collapses all permissions from presences into flat permission arrays .