File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed 
apps/contactsinteraction/lib Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,12 @@ public function createFile($name, $data = null) {
5757	public  function  getChild ($ nameCard 
5858		try  {
5959			return  new  Card (
60+ 				$ this mapper ,
6061				$ this mapper ->find (
6162					$ this getUid (),
6263					(int )$ name
6364				),
64- 				$ this principalUri ,
65- 				$ this getACL ()
65+ 				$ this principalUri 
6666			);
6767		} catch  (DoesNotExistException $ ex
6868			throw  new  NotFound ('Contact does not exist:  '  . $ exgetMessage (), 0 , $ ex
@@ -76,9 +76,9 @@ public function getChildren(): array {
7676		return  array_map (
7777			function  (RecentContact $ contact
7878				return  new  Card (
79+ 					$ this mapper ,
7980					$ contact
80- 					$ this principalUri ,
81- 					$ this getACL ()
81+ 					$ this principalUri 
8282				);
8383			},
8484			$ this mapper ->findAll ($ this getUid ())
@@ -141,6 +141,11 @@ public function getACL(): array {
141141				'principal '  => $ this getOwner (),
142142				'protected '  => true ,
143143			],
144+ 			[
145+ 				'privilege '  => '{DAV:}unbind ' ,
146+ 				'principal '  => $ this getOwner (),
147+ 				'protected '  => true ,
148+ 			],
144149		];
145150	}
146151
Original file line number Diff line number Diff line change 99namespace  OCA \ContactsInteraction ;
1010
1111use  OCA \ContactsInteraction \Db \RecentContact ;
12+ use  OCA \ContactsInteraction \Db \RecentContactMapper ;
1213use  Sabre \CardDAV \ICard ;
1314use  Sabre \DAV \Exception \NotImplemented ;
1415use  Sabre \DAVACL \ACLTrait ;
@@ -18,9 +19,9 @@ class Card implements ICard, IACL {
1819	use  ACLTrait;
1920
2021	public  function  __construct (
22+ 		private  RecentContactMapper $ mapper
2123		private  RecentContact $ contact
2224		private  string  $ principal
23- 		private  array  $ acls
2425	) {
2526	}
2627
@@ -35,7 +36,13 @@ public function getOwner(): ?string {
3536	 * @inheritDoc 
3637	 */ 
3738	public  function  getACL (): array  {
38- 		return  $ this acls ;
39+ 		return  [
40+ 			[
41+ 				'privilege '  => '{DAV:}read ' ,
42+ 				'principal '  => $ this getOwner (),
43+ 				'protected '  => true ,
44+ 			],
45+ 		];
3946	}
4047
4148	/** 
@@ -84,7 +91,7 @@ public function getSize(): int {
8491	 * @inheritDoc 
8592	 */ 
8693	public  function  delete (): void  {
87- 		throw   new   NotImplemented ( );
94+ 		$ this -> mapper -> delete ( $ this -> contact );
8895	}
8996
9097	/** 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments