Commit 237e571d authored by Odair M.'s avatar Odair M.

Merge branch 'fix-bug' into 'development'

Fix bug

See merge request !40
parents 84ff6b8a 89c4b406
......@@ -55,6 +55,12 @@
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -4,11 +4,17 @@ var app = require('../../server/server');
module.exports = function(Curso) {
Curso.search = async function(query) {
var _query = {ilike:"%"+query+"%"}
//TODO arrumar a relação de turmas, o include da turmas está pegando
//todas as turmas de todo o curso.
//como o é utilizado somente o código da sala, não precisa incluir a
//relacao sala
var _include = {disciplinas:{turmas:["professor", "horarios"]}}
var cursos = await app.models.Curso.find({where:
{or: [{nome: _query},
{codigo: _query}]}, include:_include})
// TODO
{codigo: _query}]}})
// for(var i = 0; i < cursos.length; i++) {
//
// }
return cursos;
};
......
......@@ -82,6 +82,12 @@
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -38,6 +38,12 @@
"principalId": "admin",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
}
],
"methods": {
......
......@@ -30,6 +30,12 @@
"permission": "DENY",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -57,6 +57,12 @@
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -47,6 +47,12 @@
"permission": "DENY",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -27,6 +27,12 @@
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
'use strict';
var app = require('../../server/server');
module.exports = function(Sala) {
Sala.search = async function(query) {
var _query = {ilike:"%"+query+"%"}
var _include = ["horarios"]
var salas = await app.models.Sala.find({where:
{or: [{nome: _query},
{codigo: _query}]}, include:_include})
console.log(salas)
}
};
......@@ -89,6 +89,12 @@
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......@@ -100,6 +106,13 @@
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW",
"property": "search"
}
],
"methods": {
......
......@@ -32,6 +32,12 @@
"permission": "DENY",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -34,6 +34,18 @@
}
},
"acls": [
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
"permission": "ALLOW",
"property": "*"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
......
......@@ -52,6 +52,12 @@
"permission": "DENY",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -28,6 +28,12 @@
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
......@@ -70,6 +70,12 @@
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"principalType": "ROLE",
"principalId": "comissao",
"permission": "ALLOW",
"property": "*"
},
{
"principalType": "ROLE",
"principalId": "admin",
......
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 to comment