@drax/identity-back 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/UserController.js +0 -1
- package/package.json +3 -3
- package/src/controllers/UserController.ts +1 -1
- package/test/endpoints/data/users-data.ts +38 -0
- package/test/{routes → endpoints}/tenant-route.test.ts +91 -63
- package/test/{routes → endpoints}/user-route.test.ts +41 -78
- package/test/repository/mongo/role-mongo-repository.test.ts +4 -3
- package/test/repository/mongo/user-apikey-mongo-repository.test.ts +5 -4
- package/test/repository/mongo/user-mongo-repository.test.ts +35 -48
- package/test/services/role-service.test.ts +5 -6
- package/test/services/user-service.test.ts +1 -1
- package/test/setup/MongoInMemory.ts +21 -12
- package/test/setup/TestSetup.ts +81 -4
- package/test/setup/data/admin-role.ts +5 -2
- package/test/setup/data/basic-user.ts +14 -0
- package/test/setup/data/restricted-role.ts +10 -0
- package/test/setup/data/root-user.ts +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/test/db/MongoInMemory.ts +0 -43
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import {describe,it, beforeAll, afterAll} from "vitest"
|
|
2
2
|
import {equal} from "assert";
|
|
3
3
|
import RoleMongoRepository from "../../../src/repository/mongo/RoleMongoRepository";
|
|
4
|
-
import MongoInMemory from "../../
|
|
4
|
+
import MongoInMemory from "../../setup/MongoInMemory";
|
|
5
5
|
import {IRole} from "../../../../identity-share/src/interfaces/IRole";
|
|
6
6
|
import {IDraxPaginateResult} from "@drax/crud-share";
|
|
7
7
|
|
|
8
8
|
describe("RoleRepositoryTest", function() {
|
|
9
9
|
|
|
10
|
+
const mongoInMemory = new MongoInMemory()
|
|
10
11
|
const roleReposirory = new RoleMongoRepository()
|
|
11
12
|
|
|
12
13
|
beforeAll(async () => {
|
|
13
|
-
await
|
|
14
|
+
await mongoInMemory.connect()
|
|
14
15
|
// console.log("BEFORE ROLE", MongoInMemory.mongooseStatus, MongoInMemory.serverStatus)
|
|
15
16
|
return
|
|
16
17
|
})
|
|
17
18
|
|
|
18
19
|
afterAll(async () => {
|
|
19
|
-
await
|
|
20
|
+
await mongoInMemory.dropAndClose()
|
|
20
21
|
//console.log("AFTER ROLE", MongoInMemory.status, MongoInMemory.serverStatus)
|
|
21
22
|
return
|
|
22
23
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {beforeAll, afterAll, describe, test, expect} from "vitest"
|
|
2
|
-
import
|
|
2
|
+
import {equal} from "assert";
|
|
3
3
|
import UserApiKeyMongoRepository from "../../../src/repository/mongo/UserApiKeyMongoRepository";
|
|
4
|
-
import MongoInMemory from "../../
|
|
4
|
+
import MongoInMemory from "../../setup/MongoInMemory";
|
|
5
5
|
import RoleMongoInitializer from "../../initializers/RoleMongoInitializer";
|
|
6
6
|
import UserMongoInitializer from "../../initializers/UserMongoInitializer";
|
|
7
7
|
import {IUserApiKey} from "../../../../identity-share/src/interfaces/IUserApiKey";
|
|
@@ -15,9 +15,10 @@ describe("UserApiKeyRepositoryTest", function () {
|
|
|
15
15
|
let data
|
|
16
16
|
let adminRole
|
|
17
17
|
let rootUser
|
|
18
|
+
const mongoInMemory = new MongoInMemory()
|
|
18
19
|
|
|
19
20
|
beforeAll(async () => {
|
|
20
|
-
await
|
|
21
|
+
await mongoInMemory.connect()
|
|
21
22
|
adminRole = await RoleMongoInitializer.initAdminRole()
|
|
22
23
|
rootUser = await UserMongoInitializer.initRootUser()
|
|
23
24
|
|
|
@@ -26,7 +27,7 @@ describe("UserApiKeyRepositoryTest", function () {
|
|
|
26
27
|
})
|
|
27
28
|
|
|
28
29
|
afterAll(async () => {
|
|
29
|
-
await
|
|
30
|
+
await mongoInMemory.dropAndClose()
|
|
30
31
|
//console.log("AFTER USER", MongoInMemory.status, MongoInMemory.serverStatus)
|
|
31
32
|
return
|
|
32
33
|
})
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import assert, {equal} from "assert";
|
|
1
|
+
import {beforeAll, afterAll, describe, test, expect, assert} from "vitest"
|
|
3
2
|
import UserMongoRepository from "../../../src/repository/mongo/UserMongoRepository";
|
|
4
|
-
import MongoInMemory from "../../
|
|
3
|
+
import MongoInMemory from "../../setup/MongoInMemory";
|
|
5
4
|
import RoleMongoInitializer from "../../initializers/RoleMongoInitializer";
|
|
6
5
|
import {IUser} from "../../../../identity-share/src/interfaces/IUser";
|
|
7
6
|
import type {IDraxPaginateResult} from "@drax/crud-share";
|
|
8
7
|
import {mongoose, ValidationError} from "@drax/common-back";
|
|
9
|
-
import {object} from "zod";
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
describe("UserRepositoryTest", function () {
|
|
@@ -14,9 +12,10 @@ describe("UserRepositoryTest", function () {
|
|
|
14
12
|
let userRepository = new UserMongoRepository()
|
|
15
13
|
let adminRole
|
|
16
14
|
let userAdminData
|
|
15
|
+
const mongoInMemory = new MongoInMemory()
|
|
17
16
|
|
|
18
17
|
beforeAll(async () => {
|
|
19
|
-
await
|
|
18
|
+
await mongoInMemory.connect()
|
|
20
19
|
adminRole = await RoleMongoInitializer.initAdminRole()
|
|
21
20
|
|
|
22
21
|
//console.log("BEFORE USER", MongoInMemory.mongooseStatus, MongoInMemory.serverStatus)
|
|
@@ -24,7 +23,7 @@ describe("UserRepositoryTest", function () {
|
|
|
24
23
|
})
|
|
25
24
|
|
|
26
25
|
afterAll(async () => {
|
|
27
|
-
await
|
|
26
|
+
await mongoInMemory.dropAndClose()
|
|
28
27
|
//console.log("AFTER USER", MongoInMemory.status, MongoInMemory.serverStatus)
|
|
29
28
|
return
|
|
30
29
|
})
|
|
@@ -32,42 +31,36 @@ describe("UserRepositoryTest", function () {
|
|
|
32
31
|
test("Create mongo user successfully", async function () {
|
|
33
32
|
userAdminData = (await import("../../data-obj/users/root-mongo-user")).default
|
|
34
33
|
let userCreated = await userRepository.create(userAdminData)
|
|
35
|
-
|
|
34
|
+
expect(userCreated.username).toBe(userAdminData.username)
|
|
36
35
|
})
|
|
37
36
|
|
|
38
37
|
test("Create mongo user fail same id", async function () {
|
|
39
38
|
userAdminData = (await import("../../data-obj/users/root-mongo-user")).default
|
|
40
39
|
let userData = {...userAdminData, email: "asd123@asd123.com", username: "asd123"}
|
|
41
40
|
|
|
41
|
+
await expect(
|
|
42
|
+
userRepository.create(userData)
|
|
43
|
+
).rejects.toThrow(ValidationError)
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
(error)
|
|
48
|
-
|
|
49
|
-
assert.strictEqual(error.errors[0].field, '_id');
|
|
50
|
-
return true;
|
|
51
|
-
},
|
|
52
|
-
);
|
|
45
|
+
try {
|
|
46
|
+
await userRepository.create(userData)
|
|
47
|
+
} catch (error) {
|
|
48
|
+
assert(error instanceof ValidationError)
|
|
49
|
+
expect(error.errors[0].field).toBe('_id')
|
|
50
|
+
}
|
|
53
51
|
})
|
|
54
52
|
|
|
55
53
|
test("Create mongo user fail same username", async function () {
|
|
56
54
|
userAdminData = (await import("../../data-obj/users/root-mongo-user")).default
|
|
57
55
|
let userData = {...userAdminData, _id: new mongoose.Types.ObjectId("646a661e44c93567c23d8d69"),email: "asd123@asd123.com" }
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
(error)
|
|
65
|
-
|
|
66
|
-
assert.strictEqual(error.errors[0].field, 'username');
|
|
67
|
-
assert.strictEqual(error.errors[0].reason, 'validation.unique');
|
|
68
|
-
return true;
|
|
69
|
-
},
|
|
70
|
-
);
|
|
57
|
+
try {
|
|
58
|
+
await userRepository.create(userData)
|
|
59
|
+
} catch (error) {
|
|
60
|
+
assert(error instanceof ValidationError)
|
|
61
|
+
expect(error.errors[0].field).toBe('username')
|
|
62
|
+
expect(error.errors[0].reason).toBe('validation.unique')
|
|
63
|
+
}
|
|
71
64
|
})
|
|
72
65
|
|
|
73
66
|
test("Create mongo user fail if role doesnt exist", async function () {
|
|
@@ -79,46 +72,40 @@ describe("UserRepositoryTest", function () {
|
|
|
79
72
|
role: "646a661e44c93567c23d8d89"
|
|
80
73
|
}
|
|
81
74
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
assert.strictEqual(err.errors[0].field, 'role');
|
|
90
|
-
assert.strictEqual(err.errors[0].reason, 'validation.notfound');
|
|
91
|
-
return true;
|
|
92
|
-
},
|
|
93
|
-
);
|
|
75
|
+
try {
|
|
76
|
+
await userRepository.create(userData)
|
|
77
|
+
} catch (error) {
|
|
78
|
+
assert(error instanceof ValidationError)
|
|
79
|
+
expect(error.errors[0].field).toBe('role')
|
|
80
|
+
expect(error.errors[0].reason).toBe('validation.notfound')
|
|
81
|
+
}
|
|
94
82
|
})
|
|
95
83
|
|
|
96
84
|
test("Update mongo user successfully.", async function() {
|
|
97
85
|
let adminData = (await import("../../data-obj/users/root-mongo-user")).default
|
|
98
86
|
adminData.name = "AdminUpdated"
|
|
99
87
|
let userUpdated: IUser = await userRepository.update(adminData._id, adminData)
|
|
100
|
-
|
|
88
|
+
expect(userUpdated.name).toBe(userUpdated.name)
|
|
101
89
|
})
|
|
102
90
|
|
|
103
91
|
test("Find mongo user by ID successfully", async function () {
|
|
104
92
|
let adminData = (await import("../../data-obj/users/root-mongo-user")).default
|
|
105
93
|
let userFound = await userRepository.findById(adminData._id)
|
|
106
94
|
console.log("userFound",userFound)
|
|
107
|
-
|
|
95
|
+
expect(userFound.username).toBe(userAdminData.username)
|
|
108
96
|
expect(userFound).toBeInstanceOf(Object)
|
|
109
97
|
})
|
|
110
98
|
|
|
111
99
|
test("Find mongo user by username successfully", async function () {
|
|
112
100
|
let adminData = (await import("../../data-obj/users/root-mongo-user")).default
|
|
113
101
|
let userFound = await userRepository.findByUsername(adminData.username)
|
|
114
|
-
|
|
102
|
+
expect(userFound.username).toBe(userAdminData.username)
|
|
115
103
|
})
|
|
116
104
|
|
|
117
|
-
|
|
118
105
|
test("Paginate mongo users successfully.", async function() {
|
|
119
106
|
let paginateUsers: IDraxPaginateResult<IUser> = await userRepository.paginate({page: 1, limit: 5})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
107
|
+
expect(paginateUsers.items.length).toBe(1)
|
|
108
|
+
expect(paginateUsers.total).toBe(1)
|
|
109
|
+
expect(paginateUsers.page).toBe(1)
|
|
123
110
|
})
|
|
124
111
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {describe,it, beforeAll, afterAll, assert} from "vitest"
|
|
2
2
|
import RoleService from "../../src/services/RoleService";
|
|
3
|
-
import MongoInMemory from "../
|
|
3
|
+
import MongoInMemory from "../setup/MongoInMemory";
|
|
4
4
|
import {IRole} from "../../../identity-share/src/interfaces/IRole";
|
|
5
5
|
import RoleMongoRepository from "../../src/repository/mongo/RoleMongoRepository";
|
|
6
6
|
import {IRoleRepository} from "../../src/interfaces/IRoleRepository";
|
|
@@ -8,22 +8,21 @@ import {IRoleRepository} from "../../src/interfaces/IRoleRepository";
|
|
|
8
8
|
describe("RoleServiceTest", function() {
|
|
9
9
|
let roleRepository: IRoleRepository = new RoleMongoRepository()
|
|
10
10
|
let roleService = new RoleService(roleRepository)
|
|
11
|
+
const mongoInMemory = new MongoInMemory()
|
|
12
|
+
|
|
11
13
|
beforeAll(async () => {
|
|
12
|
-
await
|
|
13
|
-
console.log("BEFORE ROLE", MongoInMemory.mongooseStatus, MongoInMemory.serverStatus)
|
|
14
|
+
await mongoInMemory.connect()
|
|
14
15
|
return
|
|
15
16
|
})
|
|
16
17
|
|
|
17
18
|
afterAll(async () => {
|
|
18
|
-
await
|
|
19
|
-
console.log("AFTER ROLE", MongoInMemory.status, MongoInMemory.serverStatus)
|
|
19
|
+
await mongoInMemory.dropAndClose()
|
|
20
20
|
return
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
it("should create role", async function() {
|
|
24
24
|
let roleData = (await import("../data-obj/roles/admin-mongo-role")).default
|
|
25
25
|
let roleCreated: IRole = await roleService.create(roleData)
|
|
26
|
-
|
|
27
26
|
assert.equal(roleCreated.name,roleData.name)
|
|
28
27
|
})
|
|
29
28
|
})
|
|
@@ -1,38 +1,47 @@
|
|
|
1
1
|
import {mongoose} from '@drax/common-back';
|
|
2
|
-
import {
|
|
2
|
+
import {MongoMemoryServer} from 'mongodb-memory-server';
|
|
3
3
|
|
|
4
|
-
class MongoInMemory{
|
|
4
|
+
class MongoInMemory {
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
mongoServer: MongoMemoryServer
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
async connect() {
|
|
9
9
|
this.mongoServer = await MongoMemoryServer.create();
|
|
10
|
-
if(this.mongoServer.state == "new"){
|
|
10
|
+
if (this.mongoServer.state == "new") {
|
|
11
11
|
await this.mongoServer.start()
|
|
12
12
|
}
|
|
13
|
-
if(!mongoose.connection.readyState){
|
|
14
|
-
await mongoose.connect(this.mongoServer.getUri(), {
|
|
13
|
+
if (!mongoose.connection.readyState) {
|
|
14
|
+
await mongoose.connect(this.mongoServer.getUri(), {dbName: "verifyMASTER"});
|
|
15
15
|
}
|
|
16
16
|
return
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
get mongooseStatus() {
|
|
20
20
|
return mongoose.connection.readyState
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
get serverStatus() {
|
|
24
24
|
return this.mongoServer.state
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
get status() {
|
|
28
28
|
return mongoose.connection.readyState
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
async disconnect() {
|
|
32
32
|
await mongoose.disconnect();
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async
|
|
35
|
+
async dropData() {
|
|
36
|
+
const collections = await mongoose.connection.listCollections()
|
|
37
|
+
for (let collection of collections) {
|
|
38
|
+
console.log(`Dropping collection: ${collection.name}`)
|
|
39
|
+
await mongoose.connection.dropCollection(collection.name)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async dropAndClose() {
|
|
36
45
|
if (this.mongoServer) {
|
|
37
46
|
await mongoose.connection.dropDatabase();
|
|
38
47
|
await mongoose.connection.close();
|
package/test/setup/TestSetup.ts
CHANGED
|
@@ -11,8 +11,13 @@ import {
|
|
|
11
11
|
UserPermissions, RolePermissions, TenantPermissions, UserApiKeyPermissions,
|
|
12
12
|
LoadPermissions
|
|
13
13
|
} from "@drax/identity-back";
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
import adminRoleData from "./data/admin-role";
|
|
16
|
+
import restrictedRoleData from "./data/restricted-role";
|
|
17
|
+
|
|
18
|
+
import rootUserData from "./data/root-user";
|
|
19
|
+
import basicUserData from "./data/basic-user";
|
|
20
|
+
|
|
16
21
|
import {IUser, IRole} from "@drax/identity-share";
|
|
17
22
|
import MongoInMemory from "./MongoInMemory";
|
|
18
23
|
|
|
@@ -21,7 +26,9 @@ class TestSetup {
|
|
|
21
26
|
private _fastifyInstance: FastifyInstance;
|
|
22
27
|
private _mongoInMemory: MongoInMemory;
|
|
23
28
|
private _rootUser: IUser;
|
|
29
|
+
private _basicUser: IUser;
|
|
24
30
|
private _adminRole: IRole;
|
|
31
|
+
private _restrictedRole: IRole;
|
|
25
32
|
|
|
26
33
|
constructor() {
|
|
27
34
|
}
|
|
@@ -33,6 +40,7 @@ class TestSetup {
|
|
|
33
40
|
this.setupFastifyInstance();
|
|
34
41
|
await this.setupMongoInMemoryAndConnect();
|
|
35
42
|
await this.setupRootUserAndAdminRole();
|
|
43
|
+
await this.setupBasicUserAndRestrictedRole();
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
setupEnvironmentVariables() {
|
|
@@ -81,7 +89,20 @@ class TestSetup {
|
|
|
81
89
|
this._rootUser = await CreateUserIfNotExist({...rootUserData})
|
|
82
90
|
}
|
|
83
91
|
|
|
84
|
-
async
|
|
92
|
+
async setupBasicUserAndRestrictedRole() {
|
|
93
|
+
this._restrictedRole = await CreateOrUpdateRole({...restrictedRoleData})
|
|
94
|
+
this._basicUser = await CreateUserIfNotExist({...basicUserData})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async dropData() {
|
|
98
|
+
await this._mongoInMemory.dropData()
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async dropAndClose() {
|
|
102
|
+
await this._mongoInMemory.dropAndClose()
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async login(username: string, password: string): Promise<{accessToken: string}> {
|
|
85
106
|
|
|
86
107
|
const resp = await this._fastifyInstance.inject({
|
|
87
108
|
method: 'POST',
|
|
@@ -99,6 +120,46 @@ class TestSetup {
|
|
|
99
120
|
|
|
100
121
|
}
|
|
101
122
|
|
|
123
|
+
async rootUserLogin(): Promise<{accessToken: string}> {
|
|
124
|
+
|
|
125
|
+
const resp = await this._fastifyInstance.inject({
|
|
126
|
+
method: 'POST',
|
|
127
|
+
url: '/api/auth/login',
|
|
128
|
+
payload: {
|
|
129
|
+
username: rootUserData.username,
|
|
130
|
+
password: rootUserData.password
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
let body = resp.json()
|
|
135
|
+
|
|
136
|
+
if(resp.statusCode === 200 && body.accessToken){
|
|
137
|
+
return {accessToken: body.accessToken}
|
|
138
|
+
}else{
|
|
139
|
+
throw new Error(`Failed to login. Status Code: ${resp.statusCode} body: ${resp.body}`)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async basicUserLogin(): Promise<{accessToken: string}> {
|
|
144
|
+
|
|
145
|
+
const resp = await this._fastifyInstance.inject({
|
|
146
|
+
method: 'POST',
|
|
147
|
+
url: '/api/auth/login',
|
|
148
|
+
payload: {
|
|
149
|
+
username: basicUserData.username,
|
|
150
|
+
password: basicUserData.password
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
let body = resp.json()
|
|
155
|
+
|
|
156
|
+
if(resp.statusCode === 200 && body.accessToken){
|
|
157
|
+
return {accessToken: body.accessToken}
|
|
158
|
+
}else{
|
|
159
|
+
throw new Error(`Failed to login. Status Code: ${resp.statusCode} body: ${resp.body}`)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
102
163
|
async me(accessToken:string): Promise<IUser> {
|
|
103
164
|
|
|
104
165
|
const resp = await this._fastifyInstance.inject({
|
|
@@ -122,18 +183,34 @@ class TestSetup {
|
|
|
122
183
|
return {...adminRoleData};
|
|
123
184
|
}
|
|
124
185
|
|
|
186
|
+
get restrictedRoleData() {
|
|
187
|
+
return {...restrictedRoleData};
|
|
188
|
+
}
|
|
189
|
+
|
|
125
190
|
get rootUserData() {
|
|
126
191
|
return {...rootUserData};
|
|
127
192
|
}
|
|
128
193
|
|
|
129
|
-
get
|
|
130
|
-
return
|
|
194
|
+
get basicUserData() {
|
|
195
|
+
return {...basicUserData};
|
|
131
196
|
}
|
|
132
197
|
|
|
133
198
|
get adminRole() {
|
|
134
199
|
return this._adminRole;
|
|
135
200
|
}
|
|
136
201
|
|
|
202
|
+
get restrictedRole() {
|
|
203
|
+
return this._restrictedRole;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
get rootUser() {
|
|
207
|
+
return this._rootUser;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
get basicUser() {
|
|
211
|
+
return this._basicUser;
|
|
212
|
+
}
|
|
213
|
+
|
|
137
214
|
get fastifyInstance() {
|
|
138
215
|
return this._fastifyInstance;
|
|
139
216
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {PermissionService} from "@drax/identity-back"
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const adminRoleData = {
|
|
4
4
|
name: "Admin",
|
|
5
5
|
permissions: PermissionService.getPermissions(),
|
|
6
6
|
childRoles: [],
|
|
7
7
|
readonly: true
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default adminRoleData
|
|
11
|
+
export {
|
|
12
|
+
adminRoleData
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
const basicUser = {
|
|
3
|
+
active: true,
|
|
4
|
+
groups: [],
|
|
5
|
+
name: "Basic User",
|
|
6
|
+
username: "basicUser",
|
|
7
|
+
password: "basic.123",
|
|
8
|
+
email: "basic@example.com",
|
|
9
|
+
phone: "123456789",
|
|
10
|
+
role: "Restricted"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default basicUser
|
|
14
|
+
export {basicUser}
|