branch develop updated (0fc7631 -> 6e0539b)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See http://git.forge.codelutin.com/coselmar.git from 0fc7631 fixes #7977 add static links new 6e0539b fixes #7991 Always allow admin to modify document The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 6e0539b32f30143ef0207b76f3c02960df430e12 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Feb 11 11:57:28 2016 +0100 fixes #7991 Always allow admin to modify document Summary of changes: .../main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java | 2 +- coselmar-ui/src/main/webapp/js/coselmar-controllers.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.forge.codelutin.com/coselmar.git commit 6e0539b32f30143ef0207b76f3c02960df430e12 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Feb 11 11:57:28 2016 +0100 fixes #7991 Always allow admin to modify document --- .../main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java | 2 +- coselmar-ui/src/main/webapp/js/coselmar-controllers.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java index 53377e2..768165f 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java @@ -562,7 +562,7 @@ public class DocumentsWebService extends CoselmarWebServiceSupport { } boolean isUsedByQuestions = getQuestionDao().forRelatedDocumentsContains(documentEntity).exists(); - if (isUsedByQuestions) { + if (isUsedByQuestions && currentUser.getRole() != CoselmarUserRole.ADMIN) { String message = "Document is used by some questions, cannot be modified."; if (log.isWarnEnabled()) { log.warn(message); diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index fd8e708..5efec92 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -465,7 +465,7 @@ coselmarControllers.controller("DocumentViewCtrl", documentService.getDocument($routeParams.documentId, function(document) { $scope.document = document; $scope.canEdit = !(document.relatedQuestions && document.relatedQuestions.length > 0); - $scope.canEdit = $scope.canEdit && ($scope.context.currentUser.role == 'ADMIN' || $scope.context.currentUser.role == 'SUPERVISOR' || $scope.context.currentUser.userId == document.ownerId); + $scope.canEdit = $scope.context.currentUser.role == 'ADMIN' || ($scope.canEdit && ($scope.context.currentUser.role == 'SUPERVISOR' || $scope.context.currentUser.userId == document.ownerId)); if (document.publicationDate) { $scope.document.publicationDate = new Date(document.publicationDate); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm