ScopeAccess component implementation (#154)

* component based on enumScope

* apply review comments

* add store props

* Revert "add store props"

This reverts commit 0e0978c5f3.

* Tests for ScopedAccess (#156)

* Tests for ScopedAccess

* Create cypress mountTestProvider

Co-authored-by: eglehelms <e.helms@cognigy.com>
Co-authored-by: Brandon Lee Kitajchuk <bk@kitajchuk.com>
This commit is contained in:
authored and GitHub committed 2022-11-29 10:19:27 -05:00
1 parent 5af7471886
commit 667e4a8883
15 files changed
+201 -91

No files matched your search

+16 -12
View File
@@ -19,13 +19,6 @@ export type UserPermissions =
| "PROVISION_SERVICES"
| "PROVISION_USERS";
// We'll want something like this for actual permissions implementation...
// export enum UserPermissions {
// VIEW_ONLY = 0,
// PROVISION_SERVICES = 1,
// PROVISION_USERS = 2,
// }
/** Status codes */
export enum StatusCodes {
@@ -106,21 +99,24 @@ export interface PasswordSettings {
/** API responses/payloads */
export interface User {
scope?: UserScopes;
scope: UserScopes;
user_sid: string;
name: string;
email: string;
is_active: boolean;
force_change: boolean;
account_sid?: string | null;
service_provider_sid?: string | null;
account_sid: string | null;
service_provider_sid: string | null;
initial_password?: string;
permissions?: UserPermissions;
permissions?: UserPermissions[];
}
export interface UserLogin extends User {
export interface UserLogin {
token: string;
force_change: boolean;
scope: UserScopes;
user_sid: string;
permissions: UserPermissions[];
}
export interface UserLoginPayload {
@@ -140,6 +136,14 @@ export interface UserUpdatePayload {
account_sid: string | null;
}
export interface UserJWT {
scope: UserScopes;
user_sid: string;
account_sid?: string | null;
service_provider_sid?: string | null;
permissions: UserPermissions[];
}
export interface ServiceProvider {
name: string;
ms_teams_fqdn: null | string;