feat: Implement get flow API endpoint

This commit is contained in:
Faruk AYDIN
2024-02-26 00:52:02 +01:00
parent 5aad68ec62
commit b93b465f09
7 changed files with 135 additions and 0 deletions

View File

@@ -144,6 +144,11 @@ class User extends Base {
},
});
get authorizedFlows() {
const conditions = this.can('read', 'Flow');
return conditions.isCreator ? this.$relatedQuery('flows') : Flow.query();
}
login(password) {
return bcrypt.compare(password, this.password);
}