mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-02 10:39:33 +00:00
Add Test.hasAccess for user validation
This commit is contained in:
@@ -114,6 +114,14 @@ class Test {
|
|||||||
return new (require('./TestTemplate'))(this.templateId);
|
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() {
|
get students() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user