We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3074f46 + b4f7363 commit 229bb42Copy full SHA for 229bb42
web/frontend/src/mocks/handlers.ts
@@ -56,6 +56,10 @@ const isAuthorized = (roles: UserRole[]): boolean => {
56
57
export const handlers = [
58
rest.get(ENDPOINT_PERSONAL_INFO, async (req, res, ctx) => {
59
+ const auth = new Map<String, Array<String>>();
60
+ auth.set('roles', ['list', 'remove', 'add']);
61
+ auth.set('proxy', ['list', 'remove', 'add']);
62
+ auth.set('election', ['create']);
63
const isLogged = sessionStorage.getItem('is-authenticated') === 'true';
64
const userId = isLogged ? mockUserID : 0;
65
const userInfos = isLogged
@@ -64,6 +68,7 @@ export const handlers = [
68
firstname: 'Alice',
69
role: UserRole.Admin,
66
70
sciper: userId,
71
+ authorization: Object.fromEntries(auth),
67
72
}
73
: {};
74
await new Promise((r) => setTimeout(r, RESPONSE_TIME));
0 commit comments