Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function comments() {
this.use(COMMENT, new Service({
Model: comment,
paginate: {
default: 15,
max: 25
}
}))
this.service(COMMENT).before({
all: [],
find: [viewRole],
get: [viewRole],
create: [modifyRole],
update: [modifyRole],
patch: [modifyRole]
})
}
export default function tracks() {
this.use(TRACK, new Service({
Model: track,
paginate: {
default: 5,
max: 25
}
}))
this.service(TRACK).before({
all: [],
find: [isRole("teacher")],
get: [isRole("teacher")],
create: [isRole("student")],
remove: [isRole("teacher")],
update: [isRole("teacher")],
patch: [isRole("teacher")]
})
export default function assignments() {
this.use(ASSIGNMENT, new Service({
Model: assignment,
paginate: {
default: 15,
max: 25
}
}))
this.service(ASSIGNMENT).before({
all: [],
find: [viewRole],
get: [viewRole],
create: [modifyRole],
update: [modifyRole],
patch: [modifyRole]
})
}
export default function quizzes() {
this.use(QUIZ, new Service({
Model: quiz,
paginate: {
default: 15,
max: 25
}
}))
this.service(QUIZ).before({
all: [],
find: [viewRole],
get: [viewRole],
create: [modifyRole],
update: [modifyRole],
patch: [modifyRole]
})
}
export default function messages() {
this.use(MESSAGE, new Service({
Model: message,
paginate: {
default: 5,
max: 25
}
}))
this.service(MESSAGE).before(standardPerms)
}
export default function users() {
this.use(USER, new Service({
Model: user,
paginate: {
default: 100,
max: 200
}
}))
this.service(USER).before({
find: [isRole(VIEW_USERS)],
get: [isRole(VIEW_USERS)],
create: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
remove: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
update: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
patch: [isRole(MODIFY_USERS), local.hooks.hashPassword()]
})
export default function messages() {
this.use(MESSAGE, new Service({
Model: message,
paginate: {
default: 5,
max: 25
}
}))
this.service(MESSAGE).before({
all: [],
find: [viewRole],
get: [viewRole],
create: [modifyRole],
update: [modifyRole],
patch: [modifyRole]
})
}
export default function courses() {
this.use(CLASS, new Service({
Model: classModel,
paginate: {
default: 15,
max: 25
}
}))
this.use("students", new StudentService())
this.service(CLASS).before(standardPerms)
}