Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2bfa5412
authored
Mar 02, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into develop
parents
3645dade
361e6807
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
sails/src/api/policies/isSupervisorOfStudentOrIsSupAdminOrIsStudent.js
sails/src/api/policies/isSupervisorOfStudentOrIsSupAdminOrIsStudent.js
View file @
2bfa5412
...
...
@@ -3,7 +3,7 @@ module.exports = function isSupervisorOfStudentOrIsSupAdminOrIsStudent (req, res
// sails.log("TOKEN: " + JSON.stringify(req.token));
if
(
!
req
.
params
.
id_stu
)
return
res
.
json
(
401
,
{
error
:
'Access denied 1'
});
// If it is a student, then is ok
return
res
.
json
(
401
,
{
error
:
'Access denied 1'
});
Student
.
findOne
(
req
.
params
.
id_stu
)
.
then
(
function
(
s
)
{
...
...
@@ -13,7 +13,7 @@ module.exports = function isSupervisorOfStudentOrIsSupAdminOrIsStudent (req, res
if
(
req
.
token
.
office
&&
s
.
office
==
req
.
token
.
office
.
id
&&
req
.
token
.
isSupAdmin
)
return
next
();
// Is Office's administrator
s
.
supervisors
((
err
,
sups
)
=>
{
Student
.
supervisors
(
req
.
params
.
id_stu
,
function
(
err
,
sups
)
{
if
(
err
||
!
sups
||
sups
.
length
==
0
)
return
res
.
json
(
401
,
{
error
:
"This student has no supervisors associated"
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment