mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 10:12:35 -04:00 
			
		
		
		
	Merge pull request #2813 from paperless-ngx/fix-2811
Fix: Disable suggestions for read-only docs
This commit is contained in:
		
						commit
						f0fa726e71
					
				| @ -306,20 +306,27 @@ export class DocumentDetailComponent | |||||||
|           ) |           ) | ||||||
|         }, |         }, | ||||||
|       }) |       }) | ||||||
|     this.documentsService |     if ( | ||||||
|       .getSuggestions(doc.id) |       this.permissionsService.currentUserHasObjectPermissions( | ||||||
|       .pipe(first()) |         PermissionAction.Change, | ||||||
|       .subscribe({ |         doc | ||||||
|         next: (result) => { |       ) | ||||||
|           this.suggestions = result |     ) { | ||||||
|         }, |       this.documentsService | ||||||
|         error: (error) => { |         .getSuggestions(doc.id) | ||||||
|           this.suggestions = null |         .pipe(first()) | ||||||
|           this.toastService.showError( |         .subscribe({ | ||||||
|             $localize`Error retrieving suggestions` + ': ' + error.toString() |           next: (result) => { | ||||||
|           ) |             this.suggestions = result | ||||||
|         }, |           }, | ||||||
|       }) |           error: (error) => { | ||||||
|  |             this.suggestions = null | ||||||
|  |             this.toastService.showError( | ||||||
|  |               $localize`Error retrieving suggestions` + ': ' + error.toString() | ||||||
|  |             ) | ||||||
|  |           }, | ||||||
|  |         }) | ||||||
|  |     } | ||||||
|     this.title = this.documentTitlePipe.transform(doc.title) |     this.title = this.documentTitlePipe.transform(doc.title) | ||||||
|     const docFormValues = Object.assign({}, doc) |     const docFormValues = Object.assign({}, doc) | ||||||
|     docFormValues['permissions_form'] = { |     docFormValues['permissions_form'] = { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user