# RoleGuard | CICADA
Documentation for CICADA

Role guard implementation. Dictates access to routes depending on the user's role.

### Hierarchy

- RoleGuard

### Implements

- CanActivate

## Index

### Constructors

- constructor

### Methods

- canActivate

## Constructors

### constructor

- new RoleGuard(router: Router): RoleGuard

- - Defined in src/app/_guards/role.guard.ts:21

  Instantiates the role guard class.

  #### Parameters

  - ##### router: Router

    A service that provides navigation among views and URL manipulation capabilities.

  #### Returns RoleGuard

## Methods

### canActivate

- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree>

- Implementation of CanActivate.canActivate

  - Defined in src/app/_guards/role.guard.ts:38

  Returns whether navigation to a specific route is acceptable. Checks if the user has the required role to access the route.

  #### Parameters

  - ##### route: ActivatedRouteSnapshot

    Contains the information about a route associated with a component loaded in an outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to traverse the router state tree.

  - ##### state: RouterStateSnapshot

    Represents the state of the router at a moment in time.

  #### Returns boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree>

  true - If the user's role matches with accepted roles.

Generated using TypeDoc