public function isAll(string $idRole, string $idResource = null): bool
    {
        $acl = $this->getAcl($idRole);
        if ($idResource) {
            $callback = function ($row) use ($idResource) {
                if ($idResource) {
                    return $row['id_resource'] == $idResource;
                }
                return true;
            };
            $res = array_values(array_filter($acl, $callback));
            if (isset($res[0])) {
                return $res[0]['id_privilege'] == self::ALL;
            }
        }

        $aclAll = array_values($acl);
        if (isset($aclAll[0])) {
            return $aclAll[0]['id_resource'] == self::ALL && $aclAll[0]['id_privilege'] == self::ALL;
        }
        return false;
    }
public function isAll(string $idRole, string $idResource = null): bool
    {
        $acl = $this->getAcl($idRole);
        if ($idResource) {
            $callback = function ($row) use ($idResource) {
                if ($idResource) {
                    return $row['id_resource'] == $idResource;
                }
                return true;
            };
            $res = array_values(array_filter($acl, $callback));
            if (isset($res[0])) {
                return $res[0]['id_privilege'] == self::ALL;
            }
        }

        $aclAll = array_values($acl);
        if (isset($aclAll[0])) {
            return $aclAll[0]['id_resource'] == self::ALL && $aclAll[0]['id_privilege'] == self::ALL;
        }
        return false;
    }
public function isAll ( string $ idRole , string $ idResource = null ) : bool { $ acl = $ this -> getAcl ( $ idRole ) ; if ( $ idResource ) { $ callback = function ( $ row ) use ( $ idResource ) { if ( $ idResource ) { return $ row [ 'id_resource' ] == $ idResource ; } return true ; } ; $ res = array_values ( array_filter ( $ acl , $ callback ) ) ; if ( isset ( $ res [ 0 ] ) ) { return $ res [ 0 ] [ 'id_privilege' ] == self :: ALL ; } } $ aclAll = array_values ( $ acl ) ; if ( isset ( $ aclAll [ 0 ] ) ) { return $ aclAll [ 0 ] [ 'id_resource' ] == self :: ALL && $ aclAll [ 0 ] [ 'id_privilege' ] == self :: ALL ; } return false ; }
Is all.

@param string      $idRole
@param string|null $idResource
@return bool
Is all .