feat(gaurds): use better smartguards to verify action authorization

This commit is contained in:
2024-05-30 22:49:39 +02:00
parent 6b3fd2ce31
commit 929f250006
18 changed files with 1116 additions and 145 deletions

View File

@ -0,0 +1,9 @@
export const users = [
{
id: 'user1',
data: {
username: 'admin',
password: 'password',
}
}
]

View File

@ -35,4 +35,17 @@ export const installDemoData = async (cloudlyRef: Cloudly) => {
await cluster.delete();
}
// ================================================================================
// USERS
const users = await cloudlyRef.authManager.CUser.getInstances({});
for (const user of users) {
await user.delete();
}
const demoDataUsers = await import('./demo.data.users.js');
for (const user of demoDataUsers.users) {
const userInstance = new cloudlyRef.authManager.CUser();
Object.assign(userInstance, user);
await userInstance.save();
}
}