1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-02 06:19:29 +00:00

Add Test.hasAccess for user validation

This commit is contained in:
2022-03-06 20:42:58 +00:00
parent 9e1894fe27
commit e19afeff73

View File

@@ -114,6 +114,14 @@ class Test {
return new (require('./TestTemplate'))(this.templateId);
}
async hasAccess(u) {
const userTests = await u.getTests();
return userTests.filter(t => {
return t.id === this.id;
}).length;
}
get students() {
}