Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 2.42 KB

README.md

File metadata and controls

65 lines (44 loc) · 2.42 KB

Permissions

Author: Thomas Laforge

Information

Structural directive is an important concept you will need to master to improve your angular skills and knowledge. This will be the first part of this challenge.

Guard is also very important since you will always need it in every application you build.

Statement

In LoginComponent, you will find 6 buttons corresponding at 6 differents users.

  • Admin
  • Manager
  • Reader
  • Writer
  • Reader and Writer
  • Client
  • Everyone

Step 1

In InformationComponent, display the correct piece of information for each roles.

Constraints:

  • no ngIf directive inside InformationComponent
  • importing the store inside InformationComponent is not allowed.

You should end up with something like below:

<div *hasRole="Role1">Info for Role1</div>
<div *hasRole="['Role1', 'Role2']">Info for Role1 and Role2</div>
<div *hasRoleSuperAdmin="true">Info Only for superadmin</div>

Step 2

In Routes.ts, route all user to the correct DashboardComponent using CanMatch guard.

Submitting your work

  1. Fork the project
  2. clone it
  3. npm ci
  4. nx serve permissions
  5. ...work on it
  6. Commit your work
  7. Submit a PR with a title beginning with Answer:6 that I will review and other dev can review.

permissions permissions solution author permissions directive blog article permissions guard blog article

You can ask any question on twitter