Commit 93db78e9 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '894-minervanet-error-report-98' into 'master'

Resolve "MINERVANET - Error Report 98"

Closes #894

See merge request !890
parents 0a4fb7c6 2d2e6154
Pipeline #12970 passed with stage
in 19 minutes and 30 seconds
...@@ -2,6 +2,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low ...@@ -2,6 +2,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server * Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
Error" (#889) Error" (#889)
* Bug fix: user without admin right can accept terms of service (#893) * Bug fix: user without admin right can accept terms of service (#893)
* Bug fix: user without admin or curator privileges shouldn't be able to
check logs (#894)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 21 Aug 2019 21:00:00 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Mon, 21 Aug 2019 21:00:00 +0200
......
...@@ -9,7 +9,6 @@ var EditProjectDialog = require('./EditProjectDialog'); ...@@ -9,7 +9,6 @@ var EditProjectDialog = require('./EditProjectDialog');
var LogListDialog = require('./LogListDialog'); var LogListDialog = require('./LogListDialog');
var PrivilegeType = require('../../map/data/PrivilegeType'); var PrivilegeType = require('../../map/data/PrivilegeType');
var ConfigurationType = require('../../ConfigurationType'); var ConfigurationType = require('../../ConfigurationType');
var UserPreferences = require('../../map/data/UserPreferences');
// noinspection JSUnusedLocalSymbols // noinspection JSUnusedLocalSymbols
var logger = require('../../logger'); var logger = require('../../logger');
...@@ -228,15 +227,26 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) { ...@@ -228,15 +227,26 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) {
if (project.getStatus().toLowerCase() !== "ok" && project.getStatus().toLowerCase() !== "failure") { if (project.getStatus().toLowerCase() !== "ok" && project.getStatus().toLowerCase() !== "failure") {
status += ' (' + project.getProgress().toFixed(2) + ' %)'; status += ' (' + project.getProgress().toFixed(2) + ' %)';
} }
var isAdmin = user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_ADMIN)) ||
user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_CURATOR));
var icon;
if (project.hasErrors()) { if (project.hasErrors()) {
status += "<a name='showErrors' href='#' data='" + project.getProjectId() + "'>" + icon = "<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:red'></i>";
"<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:red'></i>" + if (isAdmin) {
"</a>"; status += "<a name='showErrors' href='#' data='" + project.getProjectId() + "'>" + icon + "</a>";
} else {
status += icon;
}
} }
if (project.hasWarnings()) { if (project.hasWarnings()) {
status += "<a name='showWarnings' href='#' data='" + project.getProjectId() + "'>" + icon = "<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:black'></i>";
"<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:black'></i>" + if (isAdmin) {
"</a>"; status += "<a name='showWarnings' href='#' data='" + project.getProjectId() + "'>" + icon + "</a>";
} else {
status += icon;
}
} }
row[0] = formattedProjectId; row[0] = formattedProjectId;
...@@ -488,6 +498,7 @@ MapsAdminPanel.prototype.getLogDialog = function (projectId, level) { ...@@ -488,6 +498,7 @@ MapsAdminPanel.prototype.getLogDialog = function (projectId, level) {
element: Functions.createElement({ element: Functions.createElement({
type: "div" type: "div"
}), }),
configuration: self.getConfiguration(),
projectId: projectId, projectId: projectId,
customMap: null, customMap: null,
level: level level: level
......
...@@ -30,10 +30,30 @@ function PrivilegeType(data, name) { ...@@ -30,10 +30,30 @@ function PrivilegeType(data, name) {
PrivilegeType.prototype = Object.create(ObjectWithListeners.prototype); PrivilegeType.prototype = Object.create(ObjectWithListeners.prototype);
PrivilegeType.prototype.constructor = PrivilegeType; PrivilegeType.prototype.constructor = PrivilegeType;
/**
*
* @type {string}
*/
PrivilegeType.READ_PROJECT = 'READ_PROJECT'; PrivilegeType.READ_PROJECT = 'READ_PROJECT';
/**
*
* @type {string}
*/
PrivilegeType.WRITE_PROJECT = 'WRITE_PROJECT'; PrivilegeType.WRITE_PROJECT = 'WRITE_PROJECT';
/**
*
* @type {string}
*/
PrivilegeType.IS_ADMIN = 'IS_ADMIN'; PrivilegeType.IS_ADMIN = 'IS_ADMIN';
/**
*
* @type {string}
*/
PrivilegeType.IS_CURATOR = 'IS_CURATOR'; PrivilegeType.IS_CURATOR = 'IS_CURATOR';
/**
*
* @type {string}
*/
PrivilegeType.CAN_CREATE_OVERLAYS = 'CAN_CREATE_OVERLAYS'; PrivilegeType.CAN_CREATE_OVERLAYS = 'CAN_CREATE_OVERLAYS';
......
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