Эх сурвалжийг харах

New getSharePermissionsOfServer

Marino Faggiana 7 жил өмнө
parent
commit
c0190264d4

+ 1 - 0
iOSClient/Library/OCCommunicationLib/OCCommunication.h

@@ -745,6 +745,7 @@ typedef enum {
  */
 - (void) searchUsersAndGroupsWith:(NSString *)searchString forPage:(NSInteger)page with:(NSInteger)resultsPerPage ofServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSArray *itemList, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
+- (void) getSharePermissionsOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, OCCapabilities *capabilities, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 ///-----------------------------------
 /// @name Get the server capabilities
 ///-----------------------------------

+ 8 - 0
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -1250,6 +1250,14 @@
     
     OCWebDAVClient *request = [OCWebDAVClient new];
     request = [self getRequestWithCredentials:request];
+    
+    [request getSharePermissionsOfServer:serverPath onCommunication:sharedOCComunication success:^(NSHTTPURLResponse * _Nonnull operation, id  responseObject) {
+        
+        NSData *responseData = (NSData*) responseObject;
+
+    } failure:^(NSHTTPURLResponse *response, NSData *responseData, NSError *error) {
+        failureRequest(response, error, request.redirectedServer);
+    }];
 
 }
 

+ 14 - 0
iOSClient/Networking/OCNetworking.m

@@ -1327,6 +1327,20 @@
     }];
 }
 
+- (void)getSharePermissions
+{
+    OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
+    
+    [communication setCredentialsWithUser:_activeUser andPassword:_activePassword];
+    [communication setUserAgent:[CCUtility getUserAgent]];
+    
+    [communication getSharePermissionsOfServer:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, OCCapabilities *capabilities, NSString *redirectedServer) {
+        
+    } failureRequest:^(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer) {
+        
+    }];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Activity =====
 #pragma --------------------------------------------------------------------------------------------