diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js index 00d6e9f2883b3a43cd328d5d704c750e70363451..e53b58ff95287cd0c73581de742d5e4b884b002e 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormView.js @@ -884,10 +884,13 @@ function DataSetFormView(dataSetFormController, dataSetFormModel) { this._allowedToEdit = function() { var dataSet = this._dataSetFormModel.v3_dataset; - var rights = this._dataSetFormModel.rights; - var updateAllowed = rights && rights.rights.indexOf("UPDATE") >= 0; + var updateAllowed = this._allowedToUpdate(this._dataSetFormModel.rights); return updateAllowed && dataSet.frozen == false; } + + this._allowedToUpdate = function(rights) { + return rights && rights.rights.indexOf("UPDATE") >= 0; + } this._allowedToMove = function() { var dataSet = this._dataSetFormModel.v3_dataset; @@ -899,7 +902,7 @@ function DataSetFormView(dataSetFormController, dataSetFormModel) { if (sample && sample.frozenForDataSets) { return false; } - return true; + return this._allowedToUpdate(this._dataSetFormModel.rights); } this._allowedToDelete = function() { diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js index 31bcc8bb39f44500bc9cc29531ec54aae7bead13..7e1bbafe60a5138a97d39e907849f5e1f800fdfe 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js @@ -582,13 +582,20 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { this._allowedToEdit = function() { var experiment = this._experimentFormModel.v3_experiment; - var updateAllowed = this._experimentFormModel.rights.rights.indexOf("UPDATE") >= 0; + var updateAllowed = this._allowedToUpdate(this._experimentFormModel.rights); return updateAllowed && experiment.frozen == false; } + this._allowedToUpdate = function(rights) { + return rights && rights.rights.indexOf("UPDATE") >= 0; + } + this._allowedToMove = function() { var experiment = this._experimentFormModel.v3_experiment; - return experiment.project.frozenForExperiments == false; + if (experiment.project.frozenForExperiments) { + return false; + } + return this._allowedToUpdate(this._experimentFormModel.rights); } this._allowedToDelete = function() { diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ProjectForm/ProjectFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ProjectForm/ProjectFormView.js index e94fd72c3fc51e9695249560e917795e2ab9c9a5..b620a3705ec4257edb4bb88c30b30cd7784e5dd1 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ProjectForm/ProjectFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ProjectForm/ProjectFormView.js @@ -291,12 +291,19 @@ function ProjectFormView(projectFormController, projectFormModel) { this._allowedToEdit = function() { var project = this._projectFormModel.v3_project; - return project.frozen == false && this._projectFormModel.rights.rights.indexOf("UPDATE") >= 0; + return project.frozen == false && this._allowedToUpdate(this._projectFormModel.rights); }; + + this._allowedToUpdate = function(rights) { + return rights && rights.rights.indexOf("UPDATE") >= 0; + } this._allowedToMove = function() { var project = this._projectFormModel.v3_project; - return project.frozen == false && project.space.frozenForProjects == false; + if (project.frozen || project.space.frozenForProjects) { + return false; + } + return this._allowedToUpdate(this._projectFormModel.rights); }; this._allowedToDelete = function() { diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 3ba65f4165c48569ceb9b831e0ef9ce821ad6ba6..cdefad6e0bc6950543401bc45d4dfd85c57b6189 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -1280,13 +1280,21 @@ function SampleFormView(sampleFormController, sampleFormModel) { this._allowedToEdit = function() { var sample = this._sampleFormModel.v3_sample; - var updateAllowed = this._sampleFormModel.rights.rights.indexOf("UPDATE") >= 0; + var updateAllowed = this._allowedToUpdate(this._sampleFormModel.rights); return updateAllowed && sample.frozen == false; } + this._allowedToUpdate = function(rights) { + return rights && rights.rights.indexOf("UPDATE") >= 0; + } + this._allowedToMove = function() { var sample = this._sampleFormModel.v3_sample; - return !sample.experiment || sample.experiment.frozenForSamples == false; + var experiment = sample.experiment; + if (experiment && experiment.frozenForSamples) { + return false; + } + return this._allowedToUpdate(this._sampleFormModel.rights); } this._allowedToDelete = function() {