Browse Source

fix share

marinofaggiana 5 years ago
parent
commit
15d3ebd848
1 changed files with 19 additions and 0 deletions
  1. 19 0
      iOSClient/Share/CCShareOC.m

+ 19 - 0
iOSClient/Share/CCShareOC.m

@@ -194,6 +194,8 @@
     XLFormRowDescriptor *rowExpirationDateSwitch = [self.form formRowWithTag:@"expirationDateSwitch"];
     
     XLFormRowDescriptor *rowSendLinkTo = [self.form formRowWithTag:@"sendLinkTo"];
+    
+    XLFormRowDescriptor *rowFindUser = [self.form formRowWithTag:@"findUser"];
 
     // Share Link
     if ([self.shareLink length] > 0) {
@@ -317,6 +319,23 @@
         section.footerTitle = @"";
     }
     
+    // canShare
+    BOOL canShare = [self.metadata.permissions containsString:k_permission_can_share];
+    if (! canShare) {
+        
+        rowShareLinkSwitch.disabled = @YES;
+        rowShareLinkPermission.disabled = @YES;
+        rowPassword.disabled = @YES;
+        rowHideDownload.disabled = @YES;
+        rowExpirationDate.disabled = @YES;
+        rowExpirationDateSwitch.disabled = @YES;
+        rowSendLinkTo.disabled = @YES;
+        rowFindUser.disabled = @YES;
+        
+        XLFormSectionDescriptor *section = [self.form formSectionAtIndex:4];
+        [section.formRows removeAllObjects];
+    }
+    
     self.form.disabled = NO;
     
     [self.tableView reloadData];