issue #328 fixed

parent 8005ee19
......@@ -638,22 +638,25 @@ VIEW `v_stu_last_instruction` AS
I.`name` AS `ins_name`,
M.`name` AS `met_name`,
M.`id_stu` AS `id_stu`
from
`working_session` AS WS join
`instruction` AS I join
`method` AS M
where
WS.`id_ins` =I.`id`
and I.`id_met` = M.`id`
and WS.`begin` = (SELECT
MAX(WS.begin)
FROM
`working_session` AS WS join
`instruction` AS I join
`method` AS M
WHERE
WS.`id_ins` =I.`id`
and I.`id_met` = M.`id`);
FROM
`working_session` AS WS join
`instruction` AS I join
`method` AS M join
(SELECT M.`id_stu`AS id_stu,
MAX(WS.begin) AS TIME
FROM
`working_session` AS WS join
`instruction` AS I join
`method` AS M
WHERE
WS.`id_ins` =I.`id`
and I.`id_met` = M.`id`
group by M.`id_stu`) AS LAST_WS
WHERE
LAST_WS.TIME = WS.begin and
LAST_WS.id_stu = M.`id_stu` and
WS.`id_ins` =I.`id`
and I.`id_met` = M.`id`;
--
-- VIEW `v_stu_last_instruction`
......
......@@ -44,7 +44,7 @@ module.exports.policies = {
list: ['tokenAuth', 'isAdmin'],
destroy: ['tokenAuth', 'isAdmin'],
students: ['tokenAuth'],
pictos: ['tokenAuth'],
pictos: ['tokenAuth', 'isAdmin'],
upload: ['tokenAuth']
},
DeviceController: {
......@@ -76,11 +76,11 @@ module.exports.policies = {
find: ['tokenAuth'],
findOne: ['tokenAuth'],
getInfo: ['tokenAuth'],
create: ['tokenAuth', 'isSupAdmin'], // isSupAdmin too
create: ['tokenAuth',], // isSupAdmin too
update: ['tokenAuth'],
delete: ['tokenAuth', 'isSupAdmin'],
delete: ['tokenAuth'],
//destroy: ['tokenAuth'], // isSupAdmin too
devices: ['tokenAuth'], // isSupAdmin is supervisor of the
devices: ['tokenAuth' ], // isSupAdmin is supervisor of the
supervisors: ['tokenAuth'],
therapists: ['tokenAuth'],
tutors: ['tokenAuth'], // isSupervisorOfStudent falla en Student.supervisors
......@@ -93,7 +93,7 @@ module.exports.policies = {
vocabulary: true, // websockets
action: true, // websockets
config: true, // websockets
pictos: ['tokenAuth', 'isSupervisorOfStudentOrIsStudent'],
pictos: ['tokenAuth'],
add_picto: ['tokenAuth', 'isSupervisorOfStudent'],
delete_picto: ['tokenAuth', 'isSupervisorOfStudent'],
update_picto: ['tokenAuth', 'isSupervisorOfStudent'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment