Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
a7b512cb
Commit
a7b512cb
authored
Aug 22, 2019
by
Piotr Gawron
Browse files
allow user to edit project when user has write project privilege
parent
b42d9da0
Pipeline
#13018
passed with stage
in 12 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
a7b512cb
...
...
@@ -18,6 +18,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
*
Bug
fix
:
curator
couldn
't update data overlay in some situations (#905)
* Bug fix: alignment of tabs fixed for dialogs: "Add Project", "Edit Genome",
"Edit Project", "Edit User" (#881)
* Bug fix: user with modify access to the project can edit it in admin panel
(#901)
-- 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 @
a7b512cb
...
...
@@ -265,19 +265,28 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) {
row
[
4
]
=
organism
;
row
[
5
]
=
status
;
var
disabled
=
"
disabled
"
;
var
disabledEdit
=
"
disabled
"
;
var
disabledRemove
=
"
disabled
"
;
if
((
user
.
hasPrivilege
(
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
IS_ADMIN
))
||
user
.
hasPrivilege
(
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
IS_CURATOR
)))
user
.
hasPrivilege
(
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
IS_CURATOR
))
||
user
.
hasPrivilege
(
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
WRITE_PROJECT
),
project
.
getProjectId
()))
&&
(
status
.
indexOf
(
"
Ok
"
)
===
0
||
status
.
indexOf
(
"
Failure
"
)
===
0
))
{
disabled
=
""
;
disabled
Edit
=
""
;
}
row
[
6
]
=
"
<button name='showEditDialog' data='
"
+
project
.
getProjectId
()
+
"
'
"
+
disabled
+
"
><i class='fa fa-edit' style='font-size:17px'></i></button>
"
;
if
((
user
.
hasPrivilege
(
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
IS_ADMIN
))
||
(
user
.
hasPrivilege
(
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
IS_CURATOR
))
&&
user
.
hasPrivilege
(
self
.
getConfiguration
().
getPrivilegeType
(
PrivilegeType
.
WRITE_PROJECT
),
project
.
getProjectId
())))
&&
(
status
.
indexOf
(
"
Ok
"
)
===
0
||
status
.
indexOf
(
"
Failure
"
)
===
0
))
{
disabledRemove
=
""
;
}
row
[
6
]
=
"
<button name='showEditDialog' data='
"
+
project
.
getProjectId
()
+
"
'
"
+
disabledEdit
+
"
><i class='fa fa-edit' style='font-size:17px'></i></button>
"
;
if
(
self
.
getConfiguration
().
getOption
(
ConfigurationType
.
DEFAULT_MAP
).
getValue
()
===
projectId
)
{
disabled
=
"
disabled
"
;
disabled
Remove
=
"
disabled
"
;
}
row
[
7
]
=
"
<button name='removeProject' data='
"
+
project
.
getProjectId
()
+
"
'
"
+
disabled
+
"
><i class='fa fa-trash-o' style='font-size:17px'></button>
"
;
row
[
7
]
=
"
<button name='removeProject' data='
"
+
project
.
getProjectId
()
+
"
'
"
+
disabled
Remove
+
"
><i class='fa fa-trash-o' style='font-size:17px'></button>
"
;
return
row
;
};
...
...
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