Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
2d2e6154
Commit
2d2e6154
authored
Aug 21, 2019
by
Piotr Gawron
Browse files
user without admin/curator privileges shouldn't be able to access logs
parent
0a4fb7c6
Pipeline
#12966
failed with stage
in 11 minutes and 12 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
2d2e6154
...
...
@@ -2,6 +2,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
*
Bug
fix
:
fetching
list
of
miRnas
resulted
sometimes
in
"Internal Server
Error"
(#
889
)
*
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
...
...
frontend-js/src/main/js/gui/admin/MapsAdminPanel.js
View file @
2d2e6154
...
...
@@ -9,7 +9,6 @@ var EditProjectDialog = require('./EditProjectDialog');
var
LogListDialog
=
require
(
'
./LogListDialog
'
);
var
PrivilegeType
=
require
(
'
../../map/data/PrivilegeType
'
);
var
ConfigurationType
=
require
(
'
../../ConfigurationType
'
);
var
UserPreferences
=
require
(
'
../../map/data/UserPreferences
'
);
// noinspection JSUnusedLocalSymbols
var
logger
=
require
(
'
../../logger
'
);
...
...
@@ -228,15 +227,26 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) {
if
(
project
.
getStatus
().
toLowerCase
()
!==
"
ok
"
&&
project
.
getStatus
().
toLowerCase
()
!==
"
failure
"
)
{
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
())
{
status
+=
"
<a name='showErrors' href='#' data='
"
+
project
.
getProjectId
()
+
"
'>
"
+
"
<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:red'></i>
"
+
"
</a>
"
;
icon
=
"
<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:red'></i>
"
;
if
(
isAdmin
)
{
status
+=
"
<a name='showErrors' href='#' data='
"
+
project
.
getProjectId
()
+
"
'>
"
+
icon
+
"
</a>
"
;
}
else
{
status
+=
icon
;
}
}
if
(
project
.
hasWarnings
())
{
status
+=
"
<a name='showWarnings' href='#' data='
"
+
project
.
getProjectId
()
+
"
'>
"
+
"
<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:black'></i>
"
+
"
</a>
"
;
icon
=
"
<i class='fa fa-exclamation-triangle' style='font-size:18px; font-weight:400; padding-right:10px;color:black'></i>
"
;
if
(
isAdmin
)
{
status
+=
"
<a name='showWarnings' href='#' data='
"
+
project
.
getProjectId
()
+
"
'>
"
+
icon
+
"
</a>
"
;
}
else
{
status
+=
icon
;
}
}
row
[
0
]
=
formattedProjectId
;
...
...
@@ -488,6 +498,7 @@ MapsAdminPanel.prototype.getLogDialog = function (projectId, level) {
element
:
Functions
.
createElement
({
type
:
"
div
"
}),
configuration
:
self
.
getConfiguration
(),
projectId
:
projectId
,
customMap
:
null
,
level
:
level
...
...
frontend-js/src/main/js/map/data/PrivilegeType.js
View file @
2d2e6154
...
...
@@ -30,10 +30,30 @@ function PrivilegeType(data, name) {
PrivilegeType
.
prototype
=
Object
.
create
(
ObjectWithListeners
.
prototype
);
PrivilegeType
.
prototype
.
constructor
=
PrivilegeType
;
/**
*
* @type {string}
*/
PrivilegeType
.
READ_PROJECT
=
'
READ_PROJECT
'
;
/**
*
* @type {string}
*/
PrivilegeType
.
WRITE_PROJECT
=
'
WRITE_PROJECT
'
;
/**
*
* @type {string}
*/
PrivilegeType
.
IS_ADMIN
=
'
IS_ADMIN
'
;
/**
*
* @type {string}
*/
PrivilegeType
.
IS_CURATOR
=
'
IS_CURATOR
'
;
/**
*
* @type {string}
*/
PrivilegeType
.
CAN_CREATE_OVERLAYS
=
'
CAN_CREATE_OVERLAYS
'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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