feat: ou-operator permissions (createImage, prevent Centro)
parent
514c7ad1bb
commit
4224af359b
|
|
@ -1,5 +1,12 @@
|
|||
# Changelog
|
||||
|
||||
## [1.10.0] - 2026-09-17
|
||||
|
||||
### Added
|
||||
- **Permisos de Operador (ou-operator)**:
|
||||
- Añadido permiso explícito para que los operadores de aula puedan ejecutar el comando `createImage`.
|
||||
- Restringida la creación de nuevas unidades organizativas de tipo "Centro" para los usuarios con rol de operador.
|
||||
|
||||
## [1.9.0] - 2026-09-17
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ export class ExecuteCommandComponent implements OnInit {
|
|||
'power-off',
|
||||
'reboot',
|
||||
'login',
|
||||
'create-image',
|
||||
'deploy-image',
|
||||
'software-inventory',
|
||||
'hardware-inventory',
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { DataService } from "../../../services/data.service";
|
|||
import { ToastrService } from "ngx-toastr";
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { DeleteModalComponent } from '../../../../../shared/delete_modal/delete-modal/delete-modal.component';
|
||||
import { AuthService } from '@services/auth.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-manage-organizational-unit',
|
||||
|
|
@ -16,6 +17,7 @@ import { DeleteModalComponent } from '../../../../../shared/delete_modal/delete-
|
|||
})
|
||||
export class ManageOrganizationalUnitComponent implements OnInit {
|
||||
public translate = inject(TranslateService);
|
||||
public auth = inject(AuthService);
|
||||
baseUrl: string;
|
||||
isLinear = true;
|
||||
generalFormGroup: FormGroup;
|
||||
|
|
@ -141,7 +143,15 @@ export class ManageOrganizationalUnitComponent implements OnInit {
|
|||
}
|
||||
|
||||
get filteredTypes(): string[] {
|
||||
return this.generalFormGroup.get('parent')?.value ? this.types.filter(type => type !== 'organizational-unit') : this.types;
|
||||
const isOperator = this.auth.userCategory === 'ou-operator';
|
||||
const hasParent = !!this.generalFormGroup.get('parent')?.value;
|
||||
|
||||
// Si es operador de aula O ya tiene una unidad padre asignada, excluimos 'organizational-unit' (Centro)
|
||||
if (isOperator || hasParent) {
|
||||
return this.types.filter(type => type !== 'organizational-unit');
|
||||
}
|
||||
|
||||
return this.types;
|
||||
}
|
||||
|
||||
loadParentUnits(): Promise<void> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue