mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 10:27:45 +00:00 
			
		
		
		
	Update permissions when updating share via link
This commit is contained in:
		
							parent
							
								
									e7b2dde940
								
							
						
					
					
						commit
						bcb6c2c106
					
				| @ -102,6 +102,7 @@ public class UpdateRemoteShareOperation extends RemoteOperation { | |||||||
|         mPassword = null;               // no update |         mPassword = null;               // no update | ||||||
|         mExpirationDateInMillis = 0;    // no update |         mExpirationDateInMillis = 0;    // no update | ||||||
|         mPublicUpload = null; |         mPublicUpload = null; | ||||||
|  |         mPermissions = OCShare.DEFAULT_PERMISSION; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -188,15 +189,18 @@ public class UpdateRemoteShareOperation extends RemoteOperation { | |||||||
|             parametersToUpdate.add(new Pair<>(PARAM_EXPIRATION_DATE, formattedExpirationDate)); |             parametersToUpdate.add(new Pair<>(PARAM_EXPIRATION_DATE, formattedExpirationDate)); | ||||||
| 
 | 
 | ||||||
|         } // else, ignore - no update |         } // else, ignore - no update | ||||||
|         if (mPermissions > 0) { |  | ||||||
|             // set permissions |  | ||||||
|             parametersToUpdate.add(new Pair<>(PARAM_PERMISSIONS, Integer.toString(mPermissions))); |  | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         if (mPublicUpload != null) { |         if (mPublicUpload != null) { | ||||||
|             parametersToUpdate.add(new Pair<>(PARAM_PUBLIC_UPLOAD, Boolean.toString(mPublicUpload))); |             parametersToUpdate.add(new Pair<>(PARAM_PUBLIC_UPLOAD, Boolean.toString(mPublicUpload))); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         // IMPORTANT: permissions parameter needs to be updated after mPublicUpload parameter, | ||||||
|  |         // otherwise they would be set as 1 (READ) in the server when mPublicUpload was updated | ||||||
|  |         if (mPermissions > 0) { | ||||||
|  |             // set permissions | ||||||
|  |             parametersToUpdate.add(new Pair<>(PARAM_PERMISSIONS, Integer.toString(mPermissions))); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         /// perform required PUT requests |         /// perform required PUT requests | ||||||
|         PutMethod put = null; |         PutMethod put = null; | ||||||
|         String uriString; |         String uriString; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user