A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
prevent edit docs when dont have global edit perms
shamoon1718cf65041f
diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.htmlindex e7bdc8d75..d98dccfb3 100644--- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html+++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html@@ -71,7 +71,7 @@<div class="col-auto ms-auto mb-2 mb-xl-0 d-flex"><div class="btn-toolbar me-2">- <button type="button" class="btn btn-sm btn-outline-primary me-2" (click)="setPermissions()" [disabled]="!userOwnsAll">+ <button type="button" class="btn btn-sm btn-outline-primary me-2" (click)="setPermissions()" [disabled]="!userOwnsAll || !userCanEditAll"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor"><use xlink:href="assets/bootstrap-icons.svg#person-fill-lock" /></svg> <ng-container i18n>Permissions</ng-container>diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.tsindex 27b7a28f0..0c35d1d99 100644--- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts+++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts@@ -27,7 +27,11 @@ import { PaperlessStoragePath } from 'src/app/data/paperless-storage-path'import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings'import { ComponentWithPermissions } from '../../with-permissions/with-permissions.component'import { PermissionsDialogComponent } from '../../common/permissions-dialog/permissions-dialog.component'-import { PermissionsService } from 'src/app/services/permissions.service'+import {+ PermissionAction,+ PermissionsService,+ PermissionType,+} from 'src/app/services/permissions.service'import { FormControl, FormGroup } from '@angular/forms'import { first, Subject, takeUntil } from 'rxjs'@@ -83,7 +87,12 @@ export class BulkEditorComponent)get userCanEditAll(): boolean {- let canEdit: boolean = true+ let canEdit: boolean = this.permissionService.currentUserCan(+ PermissionAction.Change,+ PermissionType.Document+ )+ if (!canEdit) return false+const docs = this.list.documents.filter((d) => this.list.selected.has(d.id))canEdit = docs.every((d) =>this.permissionService.currentUserHasObjectPermissions(