You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
/**
|
|
|
* When service need public access...
|
|
|
*/
|
|
|
if (_env.is("dev")) {
|
|
|
_service.allow();
|
|
|
}
|
|
|
|
|
|
if ((_service.path.startsWith("pacientes") || _service.path.startsWith("medicos")) && (!_service.path.endsWith("get"))) {
|
|
|
_log.debug(`_group.id: ${_group.id}`);
|
|
|
_log.debug(`_user.id: ${_user.id}`);
|
|
|
_log.debug(`_auth.isJWT(): ${_auth.isJWT()}`);
|
|
|
if (_auth.isJWT() && (_group.id == 1 || _group.id == 2) && (_user.id == 1 || _user.id == 2)) {
|
|
|
_log.debug("allowed");
|
|
|
_service.allow();
|
|
|
} else {
|
|
|
_log.debug("denied");
|
|
|
_service.deny();
|
|
|
}
|
|
|
}
|