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
154e0e3c
authored
Jun 25, 2019
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
solving problem with picto expressions (issue
#478
)
parent
e4c687a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
sails/src/api/models/Grid.js
sails/src/api/policies/isAdmin.js
sails/src/api/models/Grid.js
View file @
154e0e3c
...
@@ -89,8 +89,8 @@ module.exports = {
...
@@ -89,8 +89,8 @@ module.exports = {
.
populate
(
'tags'
,
{
lang
:
student
.
lang
})
.
populate
(
'tags'
,
{
lang
:
student
.
lang
})
.
then
((
picto
)
=>
{
.
then
((
picto
)
=>
{
// check picto has expressions associated in student language
// check picto has expressions associated
manually or associated
in student language
if
(
picto
.
expressions
.
length
==
0
||
picto
.
expressions
[
0
].
text
.
length
==
0
)
if
(
!
picto
.
attributes
.
expression
&
(
picto
.
expressions
.
length
==
0
||
picto
.
expressions
[
0
].
text
.
length
==
0
)
)
stuPicto
.
attributes
.
expression
=
sails
.
__
({
stuPicto
.
attributes
.
expression
=
sails
.
__
({
phrase
:
'undef_label'
,
phrase
:
'undef_label'
,
locale
:
student
.
lang
});
locale
:
student
.
lang
});
...
...
sails/src/api/policies/isAdmin.js
View file @
154e0e3c
...
@@ -3,8 +3,8 @@ module.exports = function isAdmin (req, res, next) {
...
@@ -3,8 +3,8 @@ module.exports = function isAdmin (req, res, next) {
//
//
// Only if the user that has connected is global administrator (Yotta employee)
// Only if the user that has connected is global administrator (Yotta employee)
//
//
if
(
!
req
.
token
||
req
.
token
.
role
!==
'admin'
)
if
(
!
req
.
token
||
!
req
.
token
.
isAdmin
)
res
.
json
(
401
,
{
error
:
'Access denied'
});
res
.
json
(
401
,
{
error
:
'Access denied
. You\'re not admin!
'
});
// Finally, if the user has a clean record, we'll call the `next()` function
// Finally, if the user has a clean record, we'll call the `next()` function
// to let them through to the next policy or our controller
// to let them through to the next policy or our controller
...
...
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