Index: /sandbox/2.4.2-expresso2/prototype/services/ImapServiceAdapter.php
===================================================================
--- /sandbox/2.4.2-expresso2/prototype/services/ImapServiceAdapter.php	(revision 6700)
+++ /sandbox/2.4.2-expresso2/prototype/services/ImapServiceAdapter.php	(revision 6845)
@@ -78,12 +78,19 @@
 				foreach ($result as $res) {
 
-					$response[] = array(
+					//monta o array padrao
+					$array = array(
 							'id' => mb_convert_encoding( $res['folder_id'], 'UTF-8', 'UTF7-IMAP' ),
 							'commonName' => mb_convert_encoding( $res['folder_name'], 'UTF-8' , 'UTF7-IMAP' ),
 							'parentFolder' => mb_convert_encoding( $res['folder_parent'], 'UTF-8' , 'UTF7-IMAP' ),
 							'messageCount' => array('unseen' => isset($res['folder_unseen']) ? $res['folder_unseen'] : null, 'total' => null)
-						);
-				}
-
+					);
+
+					//se existir compartilhamento para pasta compartilhada
+					//adicionar array de permissoes
+					if(isset($res['acl_share'])){
+						$array['acl_share'] = $res['acl_share'];
+					}
+					$response[] = $array;
+				}
 				return $response;
 			}
Index: /sandbox/2.4.2-expresso2/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /sandbox/2.4.2-expresso2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 6762)
+++ /sandbox/2.4.2-expresso2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 6845)
@@ -2392,9 +2392,57 @@
 			$decifrada = mb_convert_encoding('INBOX'.$this->imap_delimiter.'decifradas','UTF7-IMAP','ISO-8859-1'); //Ignorar esta pasta decifrada
 			$parent = ($nameCount > 1 && $nameArray[($nameCount - 2)] !== 'INBOX') ? implode($this->imap_delimiter, array_slice($nameArray, 0, ($nameCount - 1))): ''; //Pega folder pai
-			if($nameArray[0] === 'user')
-				$folders[$prefixShared.$this->imap_delimiter.$nameArray[1]][] = array('id' => $folderId , 'stream' => $v->name , 'attributes' => $v->attributes , 'name' => $nameArray[($nameCount-1)] , 'user' => $nameArray[1] ,'parent' => $parent);
-			else if( $folderId !== $decifrada) //Escapa pasta decifrada
-				$folders['INBOX'][strtolower($folderId)] =  array('id' => $folderId , 'stream' => $v->name , 'attributes' => $v->attributes ,'name' => $nameArray[($nameCount-1)] , 'parent' => $parent);
-		}
+
+			if($nameArray[0] === 'user'){
+
+				//variaveis utilizadas para definição das permissões das pastas compartilhadas
+				$acl_share_create = 0;
+				$acl_share_rename = 0;
+				$acl_share_delete = 0;
+
+				//recuperando as permissões (ACLs) aplicadas na pasta
+				$imap_getacl = imap_getacl($mboxStream, $folderId);
+
+				//Se existe ACLs aplicadas a respectiva pasta (para o usuario corrente)
+				if(isset($imap_getacl[ $this->username ])){
+					$aclImap = $imap_getacl[ $this->username ];
+
+					//A partir dos atributos da ACL definir permissões para cada ação (create, rename e delete)
+					$pattern_create = '/(c|k)/';
+					$pattern_rename = '/((c|k).*(d|x))|((d|x).*(c|k))/';
+					$pattern_delete = '/(d|x)/';
+
+					$acl_share_create = preg_match($pattern_create,$aclImap);
+					$acl_share_rename = preg_match($pattern_rename,$aclImap);
+					$acl_share_delete = preg_match($pattern_delete,$aclImap);
+				}
+
+				$folders[$prefixShared.$this->imap_delimiter.$nameArray[1]][] = array(
+																						'id' => $folderId , 
+																						'stream' => $v->name , 
+																						'attributes' => $v->attributes , 
+																						'name' => $nameArray[($nameCount-1)] , 
+																						'user' => $nameArray[1] ,
+																						'parent' => $parent ,
+
+																						//Acrescentando ACLs configuradas a cada pasta compartilhada
+																						'acl_share' => array(
+																						 	'create' => $acl_share_create,
+																							'rename' => $acl_share_rename,
+																							'delete' => $acl_share_delete
+																						)
+				);
+
+ 			}	
+			else if( $folderId !== $decifrada){ //Escapa pasta decifrada
+				$folders['INBOX'][strtolower($folderId)] = array(
+																	'id' => $folderId , 
+																	'stream' => $v->name , 
+																	'attributes' => $v->attributes ,
+																	'name' => $nameArray[($nameCount-1)] , 
+																	'parent' => $parent 
+				);
+			}
+		}
+
 		unset($folders_list); //destroy array de objetos desnecessarios
 		
@@ -2414,4 +2462,9 @@
 				$append['folder_hasChildren'] = (($vv['attributes'] == 32) && ($vv['name'] != 'INBOX')) ? 1 : 0;
 				$append['folder_parent'] = $vv['parent'];
+
+				//Preparando o array de retorno para conter as ACLs configuradas para cada pasta
+				if(isset($vv['acl_share'])){
+					$append['acl_share'] = $vv['acl_share'];
+				}
 				$return[] = $append;
 			}
@@ -2420,5 +2473,5 @@
 		$quotaInfo =  (!isset($params['noQuotaInfo'])) ? $this->get_quota( array('folder_id' => $currentFolder)) : false; //VERIFICA SE O USUARIO TEM COTA
 
-		return ( ( is_array($quotaInfo) ) ?  array_merge($return, $quotaInfo) : $return );        
+		return ( ( is_array($quotaInfo) ) ?  array_merge($return, $quotaInfo) : $return );
 	}
     
