Skip to content
Snippets Groups Projects
Verified Commit f3e4bdc2 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Define roles in this folder.

parent bd26fadd
No related branches found
No related tags found
2 merge requests!69Possibility to insert a reservation and new docs.,!67Insert a reservation and search by senior.
import { withAuthorization } from 'components/Authorization/Authorization';
import { Roles } from 'roles/userRoles';
/**
* Wrapper for pages that can be accessed by all roles.
*/
export const All = withAuthorization([
Roles.admin,
Roles.operator,
Roles.senior,
Roles.driver,
]);
import { withAuthorization } from 'components/Authorization/Authorization';
import { Roles } from 'roles/userRoles';
/**
* Wrapper for pages that can be accessed by operators.
*/
export const Operator = withAuthorization([Roles.operator]);
import { withAuthorization } from 'components/Authorization/Authorization';
import { Roles } from 'roles/userRoles';
/**
* Wrapper for pages that can be accessed by seniors.
*/
export const Senior = withAuthorization([Roles.senior]);
/**
* User roles of the application.
*/
export enum Roles {
/** Website visitor, is not logged. Can access to NonAuthRoutes */
visitor = '',
/** Can access to routes wrapped by withAuthorization. */
senior = 'senior',
admin = 'admin',
operator = 'operator',
driver = 'driver',
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment