Merge branch 'better-permissions' into 'master'
Mise à jour des permissions de l'application See merge request color-recipes-explorer/frontend!14
This commit is contained in:
commit
688a6c8571
|
@ -72,7 +72,7 @@ export class AccountService implements OnDestroy {
|
|||
}
|
||||
|
||||
logout(success: () => void) {
|
||||
this.api.get<void>('/employee/logout', true).pipe(
|
||||
this.api.get<void>('/logout', true).pipe(
|
||||
take(1),
|
||||
takeUntil(this.destroy$)
|
||||
)
|
||||
|
|
|
@ -157,7 +157,7 @@ export class MixEditorComponent extends ErrorHandlingComponent {
|
|||
}
|
||||
|
||||
get canDeleteMix() {
|
||||
return this.accountService.hasPermission(EmployeePermission.REMOVE_RECIPE)
|
||||
return this.accountService.hasPermission(EmployeePermission.REMOVE_RECIPES)
|
||||
}
|
||||
|
||||
private generateForm() {
|
||||
|
|
|
@ -6,16 +6,33 @@
|
|||
<div class="mix-actions d-flex flex-row justify-content-between">
|
||||
<ng-container *ngIf="!editionMode">
|
||||
<div class="flex-grow-1">
|
||||
<mat-form-field class="dark location-input">
|
||||
<mat-form-field *ngIf="canEditRecipesPublicData" class="dark location-input">
|
||||
<mat-label>Casier</mat-label>
|
||||
<input matInput type="text" [(ngModel)]="mix.location" (change)="changeLocation($event)"/>
|
||||
<input
|
||||
matInput
|
||||
type="text"
|
||||
[(ngModel)]="mix.location"
|
||||
(change)="changeLocation($event)"/>
|
||||
</mat-form-field>
|
||||
<p *ngIf="!canEditRecipesPublicData" style="color: white">
|
||||
{{mix.location}}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<button mat-raised-button color="accent" (click)="printingConfirmBox.show()">Imprimer</button>
|
||||
<div *ngIf="canPrintMixes">
|
||||
<button
|
||||
mat-raised-button
|
||||
color="accent"
|
||||
(click)="printingConfirmBox.show()">
|
||||
Imprimer
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button mat-raised-button color="accent" (click)="deduct.emit()">Déduire</button>
|
||||
<div *ngIf="canDeductFromInventory">
|
||||
<button
|
||||
mat-raised-button
|
||||
color="accent"
|
||||
(click)="deduct.emit()">
|
||||
Déduire
|
||||
</button>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="editionMode">
|
||||
|
|
|
@ -10,6 +10,8 @@ import {ErrorService} from '../../../shared/service/error.service'
|
|||
import {AlertService} from '../../../shared/service/alert.service'
|
||||
import {environment} from '../../../../../environments/environment'
|
||||
import {MaterialService} from '../../../material/service/material.service'
|
||||
import {EmployeePermission} from '../../../shared/model/employee'
|
||||
import {AccountService} from '../../../accounts/services/account.service'
|
||||
|
||||
@Component({
|
||||
selector: 'cre-mix-table',
|
||||
|
@ -43,6 +45,7 @@ export class MixTableComponent extends SubscribingComponent {
|
|||
|
||||
constructor(
|
||||
private materialService: MaterialService,
|
||||
private accountService: AccountService,
|
||||
private alertService: AlertService,
|
||||
errorService: ErrorService,
|
||||
router: Router,
|
||||
|
@ -173,6 +176,18 @@ export class MixTableComponent extends SubscribingComponent {
|
|||
}
|
||||
}
|
||||
|
||||
get canPrintMixes(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.PRINT_MIXES)
|
||||
}
|
||||
|
||||
get canDeductFromInventory(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.DEDUCT_FROM_INVENTORY)
|
||||
}
|
||||
|
||||
get canEditRecipesPublicData(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_RECIPES_PUBLIC_DATA)
|
||||
}
|
||||
|
||||
private emitQuantityChangeEvent(index: number) {
|
||||
const quantity = this.mixMaterials[index]
|
||||
this.quantityChange.emit({
|
||||
|
|
|
@ -170,7 +170,7 @@ export class EditComponent extends ErrorHandlingComponent {
|
|||
}
|
||||
|
||||
get hasDeletePermission(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.REMOVE_RECIPE)
|
||||
return this.accountService.hasPermission(EmployeePermission.REMOVE_RECIPES)
|
||||
}
|
||||
|
||||
get loggedInEmployeeGroupId(): number {
|
||||
|
|
|
@ -4,9 +4,25 @@
|
|||
<div class="action-bar backward d-flex flex-row">
|
||||
<div class="d-flex flex-column">
|
||||
<div class="mt-1 pb-2">
|
||||
<button mat-raised-button color="primary" routerLink="/color/list">Retour</button>
|
||||
<button mat-raised-button color="primary" disabled title="WIP">Version Excel</button>
|
||||
<button mat-raised-button color="accent" (click)="saveModifications()" [disabled]="!hasModifications">
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
routerLink="/color/list">
|
||||
Retour
|
||||
</button>
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
disabled
|
||||
title="WIP">
|
||||
Version Excel
|
||||
</button>
|
||||
<button
|
||||
*ngIf="canEditRecipesPublicData"
|
||||
mat-raised-button
|
||||
color="accent"
|
||||
(click)="saveModifications()"
|
||||
[disabled]="!hasModifications">
|
||||
Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
|
@ -26,7 +42,7 @@
|
|||
|
||||
<div class="flex-grow-1"></div>
|
||||
|
||||
<mat-form-field class="w-auto">
|
||||
<mat-form-field *ngIf="canEditRecipesPublicData" class="w-auto">
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea
|
||||
matInput
|
||||
|
@ -35,6 +51,7 @@
|
|||
(keyup)="hasModifications = true">
|
||||
</textarea>
|
||||
</mat-form-field>
|
||||
<p *ngIf="!canEditRecipesPublicData">{{selectedGroupNote}}</p>
|
||||
</div>
|
||||
|
||||
<div class="recipe-content d-flex flex-row justify-content-around align-items-start flex-wrap mt-5">
|
||||
|
|
|
@ -11,6 +11,8 @@ import {InventoryService} from '../../../material/service/inventory.service'
|
|||
import {ConfirmBoxComponent} from '../../../shared/components/confirm-box/confirm-box.component'
|
||||
import {GroupService} from '../../../groups/services/group.service'
|
||||
import {AppState} from '../../../shared/app-state'
|
||||
import {AccountService} from '../../../accounts/services/account.service'
|
||||
import {EmployeePermission} from '../../../shared/model/employee'
|
||||
|
||||
@Component({
|
||||
selector: 'cre-explore',
|
||||
|
@ -41,6 +43,7 @@ export class ExploreComponent extends ErrorHandlingComponent {
|
|||
private inventoryService: InventoryService,
|
||||
private groupService: GroupService,
|
||||
private alertService: AlertService,
|
||||
private accountService: AccountService,
|
||||
private appState: AppState,
|
||||
errorService: ErrorService,
|
||||
router: Router,
|
||||
|
@ -141,6 +144,10 @@ export class ExploreComponent extends ErrorHandlingComponent {
|
|||
this.groupsNote.set(this.selectedGroupId, value)
|
||||
}
|
||||
|
||||
get canEditRecipesPublicData(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_RECIPES_PUBLIC_DATA)
|
||||
}
|
||||
|
||||
private get mappedUpdatedNotes(): Map<number, string> {
|
||||
const updatedNotes = new Map<number, string>()
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ export class ListComponent extends ErrorHandlingComponent {
|
|||
}
|
||||
|
||||
get hasEditPermission(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_RECIPE)
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_RECIPES)
|
||||
}
|
||||
|
||||
private recipeMatchesSearchQuery(recipe: Recipe) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
title="Modifier la bannière {{company.name}}"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer la bannière {{company.name}}?"
|
||||
backButtonLink="/catalog/company/list"
|
||||
deletePermission="REMOVE_COMPANY"
|
||||
deletePermission="REMOVE_COMPANIES"
|
||||
[entity]="company"
|
||||
[formFields]="formFields"
|
||||
(submit)="submit($event)"
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
[columns]="columns"
|
||||
[buttons]="buttons"
|
||||
addLink="/catalog/company/add"
|
||||
addPermission="EDIT_COMPANY">
|
||||
addPermission="EDIT_COMPANIES">
|
||||
</cre-entity-list>
|
||||
|
|
|
@ -18,7 +18,7 @@ export class ListComponent extends ErrorHandlingComponent {
|
|||
buttons = [{
|
||||
text: 'Modifier',
|
||||
linkFn: t => `/catalog/company/edit/${t.id}`,
|
||||
permission: EmployeePermission.EDIT_COMPANY
|
||||
permission: EmployeePermission.EDIT_COMPANIES
|
||||
}]
|
||||
|
||||
constructor(
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*ngIf="employee"
|
||||
title="Modification de l'utilisateur #{{employee.id}}"
|
||||
backButtonLink="/employee/list"
|
||||
deletePermission="REMOVE_EMPLOYEE"
|
||||
deletePermission="REMOVE_USERS"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer l'utilisateur #{{employee.id}}?"
|
||||
[entity]="employee"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<cre-entity-list
|
||||
addLink="/employee/add"
|
||||
addPermission="EDIT_EMPLOYEE"
|
||||
addPermission="EDIT_USERS"
|
||||
[entities$]="employees$"
|
||||
[columns]="columns"
|
||||
[buttons]="buttons"
|
||||
|
|
|
@ -33,11 +33,11 @@ export class ListComponent extends ErrorHandlingComponent {
|
|||
buttons = [{
|
||||
text: 'Modifier',
|
||||
linkFn: employee => `/employee/edit/${employee.id}`,
|
||||
permission: EmployeePermission.EDIT_EMPLOYEE
|
||||
permission: EmployeePermission.EDIT_USERS
|
||||
}, {
|
||||
text: 'Modifier mot de passe',
|
||||
linkFn: employee => `/employee/password/edit/${employee.id}`,
|
||||
permission: EmployeePermission.EDIT_EMPLOYEE_PASSWORD
|
||||
permission: EmployeePermission.EDIT_USERS
|
||||
}]
|
||||
|
||||
constructor(
|
||||
|
|
|
@ -26,6 +26,6 @@ export class EmployeesListComponent implements OnInit {
|
|||
}
|
||||
|
||||
get canEditEmployee(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_EMPLOYEE)
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_USERS)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*ngIf="group"
|
||||
title="Modifier le groupe {{group.name}}"
|
||||
backButtonLink="/group/list"
|
||||
deletePermission="REMOVE_EMPLOYEE_GROUP"
|
||||
deletePermission="REMOVE_USERS"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer le groupe {{group.name}}?"
|
||||
[entity]="group"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<cre-entity-list
|
||||
addLink="/group/add"
|
||||
addPermission="EDIT_EMPLOYEE_GROUP"
|
||||
addPermission="EDIT_USERS"
|
||||
[entities$]="groups$"
|
||||
[columns]="columns"
|
||||
[buttons]="buttons"
|
||||
|
|
|
@ -22,12 +22,11 @@ export class ListComponent extends ErrorHandlingComponent {
|
|||
buttons = [{
|
||||
text: 'Définir par défaut',
|
||||
clickFn: group => this.setDefaultGroup(group),
|
||||
permission: EmployeePermission.SET_BROWSER_DEFAULT_GROUP,
|
||||
disabledFn: group => this.isDefaultGroup(group)
|
||||
}, {
|
||||
text: 'Modifier',
|
||||
linkFn: group => `/group/edit/${group.id}`,
|
||||
permission: EmployeePermission.EDIT_EMPLOYEE_GROUP
|
||||
permission: EmployeePermission.EDIT_USERS
|
||||
}]
|
||||
|
||||
handledErrorModels: ErrorModel[] = [{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
title="Modifier le group {{materialType.name}}"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer le type de produit {{materialType.name}}?"
|
||||
backButtonLink="/catalog/materialtype/list"
|
||||
deletePermission="REMOVE_MATERIAL_TYPE"
|
||||
deletePermission="REMOVE_MATERIAL_TYPES"
|
||||
[entity]="materialType"
|
||||
[formFields]="formFields"
|
||||
(submit)="submit($event)"
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
[columns]="columns"
|
||||
[buttons]="buttons"
|
||||
addLink="/catalog/materialtype/add"
|
||||
addPermission="EDIT_MATERIAL_TYPE">
|
||||
addPermission="EDIT_MATERIAL_TYPES">
|
||||
</cre-entity-list>
|
||||
|
|
|
@ -21,7 +21,7 @@ export class ListComponent extends ErrorHandlingComponent {
|
|||
{
|
||||
text: 'Modifier',
|
||||
linkFn: t => `/catalog/materialtype/edit/${t.id}`,
|
||||
permission: EmployeePermission.EDIT_MATERIAL_TYPE,
|
||||
permission: EmployeePermission.EDIT_MATERIAL_TYPES,
|
||||
disabledFn: t => t.systemType
|
||||
}
|
||||
]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
title="Modifier le produit {{material.name}}"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer le produit {{material.name}}?"
|
||||
backButtonLink="/catalog/material/list"
|
||||
deletePermission="REMOVE_MATERIAL"
|
||||
deletePermission="REMOVE_MATERIALS"
|
||||
[entity]="material"
|
||||
[formFields]="formFields"
|
||||
(submit)="submit($event)"
|
||||
|
|
|
@ -67,13 +67,13 @@
|
|||
|
||||
<ng-container matColumnDef="addQuantity">
|
||||
<th mat-header-cell *matHeaderCellDef></th>
|
||||
<td mat-cell [class.disabled]="!canEditMaterial" *matCellDef="let material; let i = index">
|
||||
<td mat-cell [class.disabled]="!canAddToInventory" *matCellDef="let material; let i = index">
|
||||
<div
|
||||
[hidden]="!((!hoveredMaterial && i === 0) || (hoveredMaterial === material) || (selectedMaterial && selectedMaterial === material))"
|
||||
class="input-group">
|
||||
<input
|
||||
#addQuantityInput
|
||||
class="form-control"
|
||||
class="form-control w-50"
|
||||
type="number"
|
||||
step="0.01"
|
||||
placeholder="0"
|
||||
|
|
|
@ -125,6 +125,10 @@ export class InventoryComponent extends ErrorHandlingComponent {
|
|||
}
|
||||
|
||||
get canEditMaterial(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_MATERIAL)
|
||||
return this.accountService.hasPermission(EmployeePermission.EDIT_MATERIALS)
|
||||
}
|
||||
|
||||
get canAddToInventory(): boolean {
|
||||
return this.accountService.hasPermission(EmployeePermission.ADD_TO_INVENTORY)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="spacer"></div>
|
||||
<div mat-tab-nav-bar backgroundColor="primary">
|
||||
<ng-container *ngFor="let link of links">
|
||||
<ng-container *ngIf="link.route !== '/catalog' || catalogEnabled">
|
||||
<ng-container>
|
||||
<a
|
||||
*ngIf="link.enabled"
|
||||
mat-tab-link
|
||||
|
|
|
@ -12,13 +12,11 @@ import {ErrorService} from '../../service/error.service'
|
|||
styleUrls: ['./header.component.sass']
|
||||
})
|
||||
export class HeaderComponent extends SubscribingComponent {
|
||||
catalogEnabled = false
|
||||
|
||||
links: HeaderLink[] = [
|
||||
{route: '/color', title: 'Couleurs', requiredPermission: EmployeePermission.VIEW_RECIPE},
|
||||
{route: '/catalog', title: 'Catalogue', enabled: true},
|
||||
{route: '/employee', title: 'Utilisateurs', requiredPermission: EmployeePermission.VIEW_EMPLOYEE},
|
||||
{route: '/group', title: 'Groupes', requiredPermission: EmployeePermission.VIEW_EMPLOYEE_GROUP},
|
||||
{route: '/color', title: 'Couleurs', requiredPermission: EmployeePermission.VIEW_RECIPES},
|
||||
{route: '/catalog', title: 'Catalogue', enabled: true, requiredPermission: EmployeePermission.VIEW_CATALOG},
|
||||
{route: '/employee', title: 'Utilisateurs', requiredPermission: EmployeePermission.VIEW_USERS},
|
||||
{route: '/group', title: 'Groupes', requiredPermission: EmployeePermission.VIEW_USERS},
|
||||
{route: '/account/login', title: 'Connexion', enabled: true},
|
||||
{route: '/account/logout', title: 'Déconnexion', enabled: false},
|
||||
]
|
||||
|
@ -84,10 +82,6 @@ export class HeaderComponent extends SubscribingComponent {
|
|||
l.enabled = employee && employee.permissions.indexOf(l.requiredPermission) >= 0
|
||||
}
|
||||
})
|
||||
|
||||
this.catalogEnabled = this.accountService.hasPermission(EmployeePermission.VIEW_MATERIAL_TYPE) ||
|
||||
this.accountService.hasPermission(EmployeePermission.VIEW_MATERIAL) ||
|
||||
this.accountService.hasPermission(EmployeePermission.VIEW_COMPANY)
|
||||
}
|
||||
|
||||
private link(route: string) {
|
||||
|
|
|
@ -21,142 +21,108 @@ export class EmployeeGroup {
|
|||
}
|
||||
|
||||
export enum EmployeePermission {
|
||||
VIEW_MATERIAL = 'VIEW_MATERIAL',
|
||||
VIEW_MATERIAL_TYPE = 'VIEW_MATERIAL_TYPE',
|
||||
VIEW_COMPANY = 'VIEW_COMPANY',
|
||||
VIEW_RECIPE = 'VIEW_RECIPE',
|
||||
VIEW = 'VIEW',
|
||||
VIEW_EMPLOYEE = 'VIEW_EMPLOYEE',
|
||||
VIEW_EMPLOYEE_GROUP = 'VIEW_EMPLOYEE_GROUP',
|
||||
VIEW_RECIPES = 'VIEW_RECIPES',
|
||||
VIEW_USERS = 'VIEW_USERS',
|
||||
VIEW_CATALOG = 'VIEW_CATALOG',
|
||||
|
||||
EDIT_MATERIAL = 'EDIT_MATERIAL',
|
||||
EDIT_MATERIAL_TYPE = 'EDIT_MATERIAL_TYPE',
|
||||
EDIT_COMPANY = 'EDIT_COMPANY',
|
||||
EDIT_RECIPE = 'EDIT_RECIPE',
|
||||
EDIT = 'EDIT',
|
||||
EDIT_EMPLOYEE = 'EDIT_EMPLOYEE',
|
||||
EDIT_EMPLOYEE_PASSWORD = 'EDIT_EMPLOYEE_PASSWORD',
|
||||
EDIT_EMPLOYEE_GROUP = 'EDIT_EMPLOYEE_GROUP',
|
||||
PRINT_MIXES = 'PRINT_MIXES',
|
||||
|
||||
REMOVE_MATERIAL = 'REMOVE_MATERIAL',
|
||||
REMOVE_MATERIAL_TYPE = 'REMOVE_MATERIAL_TYPE',
|
||||
REMOVE_COMPANY = 'REMOVE_COMPANY',
|
||||
REMOVE_RECIPE = 'REMOVE_RECIPE',
|
||||
REMOVE = 'REMOVE',
|
||||
REMOVE_EMPLOYEE = 'REMOVE_EMPLOYEE',
|
||||
REMOVE_EMPLOYEE_GROUP = 'REMOVE_EMPLOYEE_GROUP',
|
||||
EDIT_RECIPES_PUBLIC_DATA = 'EDIT_RECIPES_PUBLIC_DATA',
|
||||
EDIT_RECIPES = 'EDIT_RECIPES',
|
||||
EDIT_MATERIALS = 'EDIT_MATERIALS',
|
||||
EDIT_MATERIAL_TYPES = 'EDIT_MATERIAL_TYPES',
|
||||
EDIT_COMPANIES = 'EDIT_COMPANIES',
|
||||
EDIT_USERS = 'EDIT_USERS',
|
||||
EDIT_CATALOG = 'EDIT_CATALOG',
|
||||
|
||||
REMOVE_RECIPES = 'REMOVE_RECIPES',
|
||||
REMOVE_MATERIALS = 'REMOVE_MATERIALS',
|
||||
REMOVE_MATERIAL_TYPES = 'REMOVE_MATERIAL_TYPES',
|
||||
REMOVE_COMPANIES = 'REMOVE_COMPANIES',
|
||||
REMOVE_USERS = 'REMOVE_USERS',
|
||||
REMOVE_CATALOG = 'REMOVE_CATALOG',
|
||||
|
||||
ADD_TO_INVENTORY = 'ADD_TO_INVENTORY',
|
||||
DEDUCT_FROM_INVENTORY = 'DEDUCT_FROM_INVENTORY',
|
||||
|
||||
SET_BROWSER_DEFAULT_GROUP = 'SET_BROWSER_DEFAULT_GROUP',
|
||||
ADMIN = 'ADMIN'
|
||||
}
|
||||
|
||||
export const mapped_permissions = {
|
||||
view: [
|
||||
{permission: EmployeePermission.VIEW_MATERIAL, description: 'Voir les produits', impliedPermissions: []},
|
||||
{
|
||||
permission: EmployeePermission.VIEW_MATERIAL_TYPE,
|
||||
description: 'Voir les types de produit',
|
||||
impliedPermissions: []
|
||||
},
|
||||
{permission: EmployeePermission.VIEW_COMPANY, description: 'Voir les bannières', impliedPermissions: []},
|
||||
{permission: EmployeePermission.VIEW_RECIPE, description: 'Voir les couleurs', impliedPermissions: []},
|
||||
{
|
||||
permission: EmployeePermission.VIEW,
|
||||
description: 'Voir',
|
||||
impliedPermissions: [EmployeePermission.VIEW_MATERIAL, EmployeePermission.VIEW_MATERIAL_TYPE, EmployeePermission.VIEW_COMPANY, EmployeePermission.VIEW_RECIPE]
|
||||
},
|
||||
{permission: EmployeePermission.VIEW_EMPLOYEE, description: 'Voir les utilisateurs', impliedPermissions: []},
|
||||
{permission: EmployeePermission.VIEW_EMPLOYEE_GROUP, description: 'Voir les groupes', impliedPermissions: []},
|
||||
{permission: EmployeePermission.VIEW_RECIPES, description: 'Voir les recettes', impliedPermissions: []},
|
||||
{permission: EmployeePermission.VIEW_CATALOG, description: 'Voir le catalogue', impliedPermissions: []},
|
||||
{permission: EmployeePermission.VIEW_USERS, description: 'Voir les utilisateurs', impliedPermissions: []},
|
||||
],
|
||||
edit: [
|
||||
{
|
||||
permission: EmployeePermission.EDIT_MATERIAL,
|
||||
description: 'Modifier les produits',
|
||||
impliedPermissions: [EmployeePermission.VIEW_MATERIAL_TYPE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.EDIT_MATERIAL_TYPE,
|
||||
description: 'Modifier les types de produit',
|
||||
impliedPermissions: [EmployeePermission.VIEW_MATERIAL_TYPE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.EDIT_COMPANY,
|
||||
description: 'Modifier les bannières',
|
||||
impliedPermissions: [EmployeePermission.VIEW_COMPANY]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.EDIT_RECIPE,
|
||||
description: 'Modifier les couleurs',
|
||||
impliedPermissions: [EmployeePermission.VIEW_RECIPE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.EDIT,
|
||||
description: 'Modifier',
|
||||
impliedPermissions: [EmployeePermission.EDIT_MATERIAL, EmployeePermission.EDIT_MATERIAL_TYPE, EmployeePermission.EDIT_COMPANY, EmployeePermission.EDIT_RECIPE, EmployeePermission.VIEW]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.EDIT_EMPLOYEE,
|
||||
description: 'Modifier les utilisateurs',
|
||||
impliedPermissions: [EmployeePermission.VIEW_EMPLOYEE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.EDIT_EMPLOYEE_PASSWORD,
|
||||
description: 'Modifier le mot de passe des employés',
|
||||
impliedPermissions: [EmployeePermission.EDIT_EMPLOYEE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.EDIT_EMPLOYEE_GROUP,
|
||||
description: 'Modifier les groupes',
|
||||
impliedPermissions: [EmployeePermission.VIEW_EMPLOYEE_GROUP]
|
||||
},
|
||||
],
|
||||
remove: [
|
||||
{
|
||||
permission: EmployeePermission.REMOVE_MATERIAL,
|
||||
description: 'Supprimer des produits',
|
||||
impliedPermissions: [EmployeePermission.EDIT_MATERIAL]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.REMOVE_MATERIAL_TYPE,
|
||||
description: 'Supprimer des types de produit',
|
||||
impliedPermissions: [EmployeePermission.EDIT_MATERIAL_TYPE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.REMOVE_COMPANY,
|
||||
description: 'Supprimer des bannières',
|
||||
impliedPermissions: [EmployeePermission.EDIT_COMPANY]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.REMOVE_RECIPE,
|
||||
description: 'Supprimer des couleurs',
|
||||
impliedPermissions: [EmployeePermission.EDIT_RECIPE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.REMOVE,
|
||||
description: 'Supprimer',
|
||||
impliedPermissions: [EmployeePermission.REMOVE_MATERIAL, EmployeePermission.REMOVE_MATERIAL_TYPE, EmployeePermission.REMOVE_COMPANY, EmployeePermission.REMOVE_RECIPE, EmployeePermission.EDIT]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.REMOVE_EMPLOYEE,
|
||||
description: 'Supprimer des utilisateurs',
|
||||
impliedPermissions: [EmployeePermission.EDIT_EMPLOYEE]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.REMOVE_EMPLOYEE_GROUP,
|
||||
description: 'Supprimer des groupes',
|
||||
impliedPermissions: [EmployeePermission.EDIT_EMPLOYEE_GROUP]
|
||||
},
|
||||
],
|
||||
other: [
|
||||
{
|
||||
permission: EmployeePermission.SET_BROWSER_DEFAULT_GROUP,
|
||||
description: 'Définir le groupe par défaut',
|
||||
impliedPermissions: [EmployeePermission.VIEW_EMPLOYEE_GROUP]
|
||||
},
|
||||
{
|
||||
permission: EmployeePermission.ADMIN,
|
||||
description: 'Administrateur',
|
||||
impliedPermissions: [EmployeePermission.REMOVE, EmployeePermission.SET_BROWSER_DEFAULT_GROUP, EmployeePermission.REMOVE_EMPLOYEE, EmployeePermission.EDIT_EMPLOYEE_PASSWORD, EmployeePermission.REMOVE_EMPLOYEE_GROUP]
|
||||
}
|
||||
]
|
||||
edit: [{
|
||||
permission: EmployeePermission.EDIT_RECIPES_PUBLIC_DATA,
|
||||
description: 'Modifier les données publiques des recettes',
|
||||
impliedPermissions: [EmployeePermission.VIEW_RECIPES]
|
||||
}, {
|
||||
permission: EmployeePermission.EDIT_RECIPES,
|
||||
description: 'Modifier les recettes',
|
||||
impliedPermissions: [EmployeePermission.EDIT_RECIPES_PUBLIC_DATA]
|
||||
}, {
|
||||
permission: EmployeePermission.EDIT_MATERIALS,
|
||||
description: 'Modifier les produits',
|
||||
impliedPermissions: [EmployeePermission.VIEW_CATALOG]
|
||||
}, {
|
||||
permission: EmployeePermission.EDIT_MATERIAL_TYPES,
|
||||
description: 'Modifier les types de produit',
|
||||
impliedPermissions: [EmployeePermission.VIEW_CATALOG]
|
||||
}, {
|
||||
permission: EmployeePermission.EDIT_COMPANIES,
|
||||
description: 'Modifier les bannières',
|
||||
impliedPermissions: [EmployeePermission.VIEW_CATALOG]
|
||||
}, {
|
||||
permission: EmployeePermission.EDIT_CATALOG,
|
||||
description: 'Modifier le catalogue',
|
||||
impliedPermissions: [EmployeePermission.EDIT_MATERIALS, EmployeePermission.EDIT_MATERIAL_TYPES, EmployeePermission.EDIT_COMPANIES]
|
||||
}, {
|
||||
permission: EmployeePermission.EDIT_USERS,
|
||||
description: 'Modifier les utilisateurs',
|
||||
impliedPermissions: [EmployeePermission.VIEW_USERS]
|
||||
}],
|
||||
remove: [{
|
||||
permission: EmployeePermission.REMOVE_RECIPES,
|
||||
description: 'Supprimer des recettes',
|
||||
impliedPermissions: [EmployeePermission.EDIT_RECIPES]
|
||||
}, {
|
||||
permission: EmployeePermission.REMOVE_MATERIALS,
|
||||
description: 'Supprimer des produits',
|
||||
impliedPermissions: [EmployeePermission.EDIT_MATERIALS]
|
||||
}, {
|
||||
permission: EmployeePermission.REMOVE_MATERIAL_TYPES,
|
||||
description: 'Supprimer des types de produit',
|
||||
impliedPermissions: [EmployeePermission.EDIT_MATERIAL_TYPES]
|
||||
}, {
|
||||
permission: EmployeePermission.REMOVE_COMPANIES,
|
||||
description: 'Supprimer des bannières',
|
||||
impliedPermissions: [EmployeePermission.EDIT_COMPANIES]
|
||||
}, {
|
||||
permission: EmployeePermission.REMOVE_CATALOG,
|
||||
description: 'Supprimer dans le catalogue',
|
||||
impliedPermissions: [EmployeePermission.REMOVE_MATERIALS, EmployeePermission.REMOVE_MATERIAL_TYPES, EmployeePermission.REMOVE_COMPANIES]
|
||||
}, {
|
||||
permission: EmployeePermission.REMOVE_USERS,
|
||||
description: 'Supprimer des utilisateurs',
|
||||
impliedPermissions: [EmployeePermission.EDIT_USERS]
|
||||
}],
|
||||
other: [{
|
||||
permission: EmployeePermission.PRINT_MIXES,
|
||||
description: 'Imprimer les mélanges (bPac)',
|
||||
impliedPermissions: [EmployeePermission.VIEW_RECIPES]
|
||||
}, {
|
||||
permission: EmployeePermission.ADD_TO_INVENTORY,
|
||||
description: 'Ajouter dans l\'inventaire',
|
||||
impliedPermissions: [EmployeePermission.VIEW_CATALOG]
|
||||
}, {
|
||||
permission: EmployeePermission.DEDUCT_FROM_INVENTORY,
|
||||
description: 'Déduire dans l\'inventaire',
|
||||
impliedPermissions: [EmployeePermission.VIEW_RECIPES]
|
||||
}, {
|
||||
permission: EmployeePermission.ADMIN,
|
||||
description: 'Administrateur',
|
||||
impliedPermissions: [EmployeePermission.EDIT_CATALOG, EmployeePermission.REMOVE_RECIPES, EmployeePermission.REMOVE_USERS, EmployeePermission.REMOVE_CATALOG, EmployeePermission.PRINT_MIXES, EmployeePermission.ADD_TO_INVENTORY, EmployeePermission.DEDUCT_FROM_INVENTORY]
|
||||
}]
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ import {GlobalAlertHandlerComponent} from '../../modules/shared/components/globa
|
|||
})
|
||||
export class CatalogComponent implements OnInit, OnDestroy {
|
||||
links: NavLink[] = [
|
||||
{route: '/catalog/materialtype', title: 'Types de produit', permission: EmployeePermission.VIEW_MATERIAL_TYPE},
|
||||
{route: '/catalog/material', title: 'Inventaire', permission: EmployeePermission.VIEW_MATERIAL},
|
||||
{route: '/catalog/company', title: 'Bannières', permission: EmployeePermission.VIEW_COMPANY}
|
||||
{route: '/catalog/materialtype', title: 'Types de produit', permission: EmployeePermission.VIEW_CATALOG},
|
||||
{route: '/catalog/material', title: 'Inventaire', permission: EmployeePermission.VIEW_CATALOG},
|
||||
{route: '/catalog/company', title: 'Bannières', permission: EmployeePermission.VIEW_CATALOG}
|
||||
]
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
Loading…
Reference in New Issue