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
ab5c1d43
authored
Feb 23, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #949 fixed
parent
c7e70c85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
sails/src/api/controllers/StudentController.js
sails/src/config/policies.js
sails/src/api/controllers/StudentController.js
View file @
ab5c1d43
...
...
@@ -144,7 +144,9 @@ module.exports = {
else
if
(
stu_sup
&&
!
req
.
token
.
office
)
student
.
supervision
=
1
;
// requester is tutor of the studend
else
if
(
stu_sup
&&
req
.
token
.
office
&&
student
.
office
==
req
.
token
.
office
.
id
)
student
.
supervision
=
2
;
// requester is supervisor of student
student
.
supervision
=
2
;
// requester is supervisor of student
else
if
(
req
.
token
.
isStudent
&&
req
.
token
.
id
==
student
.
id
)
student
.
supervision
=
3
// requester is the student himself
if
(
student
.
supervision
==
-
1
)
// should not hace access!!!
return
res
.
forbidden
(
"Access to this student should not be granted to you"
);
...
...
sails/src/config/policies.js
View file @
ab5c1d43
...
...
@@ -86,7 +86,7 @@ module.exports.policies = {
StudentController
:
{
eternal
:
true
,
getInfo
:
[
'tokenAuth'
,
'isSupervisorOfStudentOrIsSupAdmin'
],
getInfo
:
[
'tokenAuth'
,
'isSupervisorOfStudentOrIsSupAdmin
OrIsStudent
'
],
supervisors
:
[
'tokenAuth'
],
therapists
:
[
'tokenAuth'
],
tutors
:
[
'tokenAuth'
],
...
...
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