feat(challenge6): improve readme

This commit is contained in:
thomas
2022-11-22 14:07:50 +01:00
parent a46b9eb1a9
commit b8aae9b8f8
4 changed files with 24 additions and 2 deletions

View File

@@ -9,10 +9,12 @@ import { UserStore } from './user.store';
template: `
<h2 class="mt-10 text-xl">Information Panel</h2>
<!-- admin can see everything -->
<div>visible only for super admin</div>
<div>visible if manager</div>
<div>visible if manager and/or reader</div>
<div>visible if manager and/or writer</div>
<div>visible if client</div>
<div>visible for everyone</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})

View File

@@ -5,6 +5,7 @@ import { InformationComponent } from './information.component';
import {
admin,
client,
everyone,
manager,
reader,
readerAndWriter,
@@ -25,6 +26,7 @@ import { UserStore } from './user.store';
<button app-button (click)="writer()">Writer</button>
<button app-button (click)="readerWriter()">Reader and Writer</button>
<button app-button (click)="client()">Client</button>
<button app-button (click)="everyone()">Client</button>
</header>
<app-information></app-information>
@@ -55,4 +57,7 @@ export class LoginComponent {
client() {
this.userStore.add(client);
}
everyone() {
this.userStore.add(everyone);
}
}

View File

@@ -41,3 +41,9 @@ export const client: User = {
isAdmin: false,
roles: ['CLIENT'],
};
export const everyone: User = {
name: 'client',
isAdmin: false,
roles: [],
};