mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 17:59:25 +00:00
Added Class.hasAccess to validate user input and add security
This commit is contained in:
@@ -196,6 +196,14 @@ class Class {
|
||||
return await Promise.all(testObjects);
|
||||
}
|
||||
|
||||
async hasAccess(u) {
|
||||
const userClasses = await u.getClasses();
|
||||
|
||||
return userClasses.filter(c => {
|
||||
return c.id === this.id;
|
||||
}).length;
|
||||
}
|
||||
|
||||
addTeacher() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user