mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-26 03:36:08 -05:00 
			
		
		
		
	fix inherited permissions not visually showing as checked
This commit is contained in:
		| @@ -18,7 +18,7 @@ | |||||||
|             </div> |             </div> | ||||||
|             <div class="form-check form-switch form-check-inline"> |             <div class="form-check form-switch form-check-inline"> | ||||||
|               <input type="checkbox" class="form-check-input" id="is_superuser" formControlName="is_superuser" (change)="onToggleSuperUser()"> |               <input type="checkbox" class="form-check-input" id="is_superuser" formControlName="is_superuser" (change)="onToggleSuperUser()"> | ||||||
|               <label class="form-check-label" for="is_superuser"><ng-container i18n>Superuser</ng-container> <small class="form-text text-muted ms-1" i18n>(Grants all permissions)</small></label> |               <label class="form-check-label" for="is_superuser"><ng-container i18n>Superuser</ng-container> <small class="form-text text-muted ms-1" i18n>(Grants all permissions and objects)</small></label> | ||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ | |||||||
|       <div class="col-3">{{type.key}}:</div> |       <div class="col-3">{{type.key}}:</div> | ||||||
|  |  | ||||||
|       <div class="col form-check form-check-inline form-switch" [ngbPopover]="inheritedWarning" [disablePopover]="!isInherited(type.key)" placement="left" triggers="mouseenter:mouseleave"> |       <div class="col form-check form-check-inline form-switch" [ngbPopover]="inheritedWarning" [disablePopover]="!isInherited(type.key)" placement="left" triggers="mouseenter:mouseleave"> | ||||||
|         <input type="checkbox" class="form-check-input" id="{{type.key}}_all" (change)="toggleAll($event, type.key)" [checked]="typesWithAllActions.has(type.key)" [attr.disabled]="disabled || isInherited(type.key) ? true : null"> |         <input type="checkbox" class="form-check-input" id="{{type.key}}_all" (change)="toggleAll($event, type.key)" [checked]="typesWithAllActions.has(type.key) || isInherited(type.key)" [attr.disabled]="disabled || isInherited(type.key) ? true : null"> | ||||||
|         <label class="form-check-label visually-hidden" for="{{type.key}}_all" i18n>All</label> |         <label class="form-check-label visually-hidden" for="{{type.key}}_all" i18n>All</label> | ||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -46,9 +46,14 @@ export class PermissionsSelectComponent | |||||||
|   @Input() |   @Input() | ||||||
|   set inheritedPermissions(inherited: string[]) { |   set inheritedPermissions(inherited: string[]) { | ||||||
|     // remove <app_label>. from permission strings |     // remove <app_label>. from permission strings | ||||||
|     this._inheritedPermissions = inherited?.length |     const newInheritedPermissions = inherited?.length | ||||||
|       ? inherited.map((p) => p.replace(/^\w+\./g, '')) |       ? inherited.map((p) => p.replace(/^\w+\./g, '')) | ||||||
|       : [] |       : [] | ||||||
|  |  | ||||||
|  |     if (this._inheritedPermissions !== newInheritedPermissions) { | ||||||
|  |       this._inheritedPermissions = newInheritedPermissions | ||||||
|  |       this.writeValue(this.permissions) // updates visual checks etc. | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   inheritedWarning: string = $localize`Inerhited from group` |   inheritedWarning: string = $localize`Inerhited from group` | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon