From 79bc5caaac77146ae7dac6c45f06ad182d529ac7 Mon Sep 17 00:00:00 2001 From: MarvinDo Date: Wed, 10 Jan 2024 11:02:25 +0100 Subject: [PATCH] fixed a bug when accessing the variant details page as read only or standard user --- .../backups/database_dumper/dump_database.sh | 2 + .../database_dumper/update_database_3.sql | 144 +++++++++--------- .../database_dumper/users/user_privileges.sql | 4 +- .../webapp/templates/index.html | 1 + 4 files changed, 80 insertions(+), 71 deletions(-) diff --git a/resources/backups/database_dumper/dump_database.sh b/resources/backups/database_dumper/dump_database.sh index 113cba18..c6ea5d52 100755 --- a/resources/backups/database_dumper/dump_database.sh +++ b/resources/backups/database_dumper/dump_database.sh @@ -31,6 +31,8 @@ echo $DATE > most_recent_dump.txt # information after init_db.py ##mysqldump --quick -h sql.img.med.uni-tuebingen.de -P 3306 -u ahdoebm1 -p --column-statistics=0 --no-tablespaces --no-create-info -r /mnt/storage2/users/ahdoebm1/HerediVar/resources/backups/database_dumper/init_db/init_transcripts.sql HerediVar_ahdoebm1 gene gene_alias transcript exon +##mysqldump --quick -h sql.img.med.uni-tuebingen.de -P 3306 -u ahdoebm1 -p --column-statistics=0 --no-tablespaces -r /mnt/storage2/users/ahdoebm1/HerediVar/resources/backups/database_dumper/init_db/task_force_protein_domains.sql HerediVar_ahdoebm1 task_force_protein_domains + #mysqldump --quick -h SRV011.img.med.uni-tuebingen.de -P 3306 -u ahdoebm1 -p --column-statistics=0 --no-tablespaces --no-create-info -r /mnt/storage2/users/ahdoebm1/HerediVar/resources/backups/database_dumper/init_db/init.sql HerediVar_ahdoebm1 annotation_type classification_criterium classification_criterium_strength classification_scheme mutually_exclusive_criteria gene gene_alias pfam_id_mapping pfam_legacy task_force_protein_domains transcript diff --git a/resources/backups/database_dumper/update_database_3.sql b/resources/backups/database_dumper/update_database_3.sql index 8e1c230b..9ca01f32 100644 --- a/resources/backups/database_dumper/update_database_3.sql +++ b/resources/backups/database_dumper/update_database_3.sql @@ -178,74 +178,78 @@ -- ; -ALTER TABLE `HerediVar`.`classification_scheme` -ADD COLUMN `version` VARCHAR(45) NOT NULL DEFAULT 'v1.0.0' AFTER `name`; -UPDATE classification_scheme SET version = "v1.4.0" WHERE name = "enigma-tp53"; -UPDATE classification_scheme SET version = "v1.1.0" WHERE name = "enigma-ATM"; - -ALTER TABLE `HerediVar`.`classification_scheme` -CHANGE COLUMN `name` `name` VARCHAR(45) NOT NULL ; - - -ALTER TABLE `HerediVar`.`classification_scheme` -ADD UNIQUE INDEX `UNIQUE_classification_scheme` (`name` ASC, `version` ASC); -; - - -ALTER TABLE `HerediVar`.`mutually_inclusive_criteria` -DROP FOREIGN KEY `FK_mutually_inclusive_criteria_source`, -DROP FOREIGN KEY `FK_mutually_inlusive_criteria_target`; -ALTER TABLE `HerediVar`.`mutually_inclusive_criteria` -ADD CONSTRAINT `FK_mutually_inclusive_criteria_source` - FOREIGN KEY (`source`) - REFERENCES `HerediVar`.`classification_criterium` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION, -ADD CONSTRAINT `FK_mutually_inlusive_criteria_target` - FOREIGN KEY (`target`) - REFERENCES `HerediVar`.`classification_criterium` (`id`) - ON DELETE CASCADE - ON UPDATE NO ACTION; - - -CREATE TABLE `HerediVar`.`classification_scheme_alias` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `classification_scheme_id` INT UNSIGNED NOT NULL, - `alias` VARCHAR(45) NOT NULL, - PRIMARY KEY (`id`)) -ENGINE = InnoDB -DEFAULT CHARACTER SET = utf8; - - -ALTER TABLE `HerediVar`.`classification_scheme_alias` -ADD INDEX `FK_classification_scheme_alias_classification_scheme_idx` (`classification_scheme_id` ASC); -; -ALTER TABLE `HerediVar`.`classification_scheme_alias` -ADD CONSTRAINT `FK_classification_scheme_alias_classification_scheme` - FOREIGN KEY (`classification_scheme_id`) - REFERENCES `HerediVar`.`classification_scheme` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - - -GRANT SELECT ON HerediVar.classification_scheme_alias TO 'HerediVar_annotation'; -GRANT SELECT ON HerediVar.classification_scheme TO 'HerediVar_annotation'; -GRANT SELECT,INSERT,UPDATE,DELETE ON HerediVar.classification_scheme_alias TO 'HerediVar_superuser'; - - - -ALTER TABLE `HerediVar`.`automatic_classification` -DROP COLUMN `scheme_name`; - -ALTER TABLE `HerediVar`.`automatic_classification` -ADD COLUMN `classification_scheme_id` INT UNSIGNED NOT NULL AFTER `variant_id`; +-- ALTER TABLE `HerediVar`.`classification_scheme` +-- ADD COLUMN `version` VARCHAR(45) NOT NULL DEFAULT 'v1.0.0' AFTER `name`; +-- UPDATE classification_scheme SET version = "v1.4.0" WHERE name = "enigma-tp53"; +-- UPDATE classification_scheme SET version = "v1.1.0" WHERE name = "enigma-ATM"; +-- +-- ALTER TABLE `HerediVar`.`classification_scheme` +-- CHANGE COLUMN `name` `name` VARCHAR(45) NOT NULL ; +-- +-- +-- ALTER TABLE `HerediVar`.`classification_scheme` +-- ADD UNIQUE INDEX `UNIQUE_classification_scheme` (`name` ASC, `version` ASC); +-- ; +-- +-- +-- ALTER TABLE `HerediVar`.`mutually_inclusive_criteria` +-- DROP FOREIGN KEY `FK_mutually_inclusive_criteria_source`, +-- DROP FOREIGN KEY `FK_mutually_inlusive_criteria_target`; +-- ALTER TABLE `HerediVar`.`mutually_inclusive_criteria` +-- ADD CONSTRAINT `FK_mutually_inclusive_criteria_source` +-- FOREIGN KEY (`source`) +-- REFERENCES `HerediVar`.`classification_criterium` (`id`) +-- ON DELETE CASCADE +-- ON UPDATE NO ACTION, +-- ADD CONSTRAINT `FK_mutually_inlusive_criteria_target` +-- FOREIGN KEY (`target`) +-- REFERENCES `HerediVar`.`classification_criterium` (`id`) +-- ON DELETE CASCADE +-- ON UPDATE NO ACTION; +-- +-- +-- CREATE TABLE `HerediVar`.`classification_scheme_alias` ( +-- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, +-- `classification_scheme_id` INT UNSIGNED NOT NULL, +-- `alias` VARCHAR(45) NOT NULL, +-- PRIMARY KEY (`id`)) +-- ENGINE = InnoDB +-- DEFAULT CHARACTER SET = utf8; +-- +-- +-- ALTER TABLE `HerediVar`.`classification_scheme_alias` +-- ADD INDEX `FK_classification_scheme_alias_classification_scheme_idx` (`classification_scheme_id` ASC); +-- ; +-- ALTER TABLE `HerediVar`.`classification_scheme_alias` +-- ADD CONSTRAINT `FK_classification_scheme_alias_classification_scheme` +-- FOREIGN KEY (`classification_scheme_id`) +-- REFERENCES `HerediVar`.`classification_scheme` (`id`) +-- ON DELETE NO ACTION +-- ON UPDATE NO ACTION; +-- +-- +-- GRANT SELECT ON HerediVar.classification_scheme_alias TO 'HerediVar_annotation'; +-- GRANT SELECT ON HerediVar.classification_scheme TO 'HerediVar_annotation'; +-- GRANT SELECT,INSERT,UPDATE,DELETE ON HerediVar.classification_scheme_alias TO 'HerediVar_superuser'; +-- +-- +-- +-- ALTER TABLE `HerediVar`.`automatic_classification` +-- DROP COLUMN `scheme_name`; +-- +-- ALTER TABLE `HerediVar`.`automatic_classification` +-- ADD COLUMN `classification_scheme_id` INT UNSIGNED NOT NULL AFTER `variant_id`; +-- +-- ALTER TABLE `HerediVar`.`automatic_classification` +-- ADD INDEX `FK_autoclass_classification_scheme_idx` (`classification_scheme_id` ASC); +-- ; +-- ALTER TABLE `HerediVar`.`automatic_classification` +-- ADD CONSTRAINT `FK_autoclass_classification_scheme` +-- FOREIGN KEY (`classification_scheme_id`) +-- REFERENCES `HerediVar`.`classification_scheme` (`id`) +-- ON DELETE NO ACTION +-- ON UPDATE NO ACTION; +-- -ALTER TABLE `HerediVar`.`automatic_classification` -ADD INDEX `FK_autoclass_classification_scheme_idx` (`classification_scheme_id` ASC); -; -ALTER TABLE `HerediVar`.`automatic_classification` -ADD CONSTRAINT `FK_autoclass_classification_scheme` - FOREIGN KEY (`classification_scheme_id`) - REFERENCES `HerediVar`.`classification_scheme` (`id`) - ON DELETE NO ACTION - ON UPDATE NO ACTION; +GRANT INSERT,UPDATE ON HerediVar.heredivar_clinvar_submissions TO 'HerediVar_user'; +GRANT INSERT,UPDATE ON HerediVar.heredivar_clinvar_submissions TO 'HerediVar_read_only'; \ No newline at end of file diff --git a/resources/backups/database_dumper/users/user_privileges.sql b/resources/backups/database_dumper/users/user_privileges.sql index cb0b39e6..25f9e920 100644 --- a/resources/backups/database_dumper/users/user_privileges.sql +++ b/resources/backups/database_dumper/users/user_privileges.sql @@ -50,6 +50,7 @@ GRANT SELECT ON HerediVar_ahdoebm1.gene_alias TO 'HerediVar_user'; GRANT SELECT ON HerediVar_ahdoebm1.variant_heredicare_annotation TO 'HerediVar_user'; GRANT SELECT ON HerediVar_ahdoebm1.variant_transcript_annotation TO 'HerediVar_user'; GRANT SELECT ON HerediVar_ahdoebm1.mutually_inclusive_criteria TO 'HerediVar_user'; +GRANT INSERT,UPDATE ON HerediVar_ahdoebm1.heredivar_clinvar_submissions TO 'HerediVar_user'; /* grant priviliges to super user */ GRANT SELECT, INSERT, UPDATE ON HerediVar_ahdoebm1.user TO 'HerediVar_superuser'; @@ -94,4 +95,5 @@ GRANT INSERT, DELETE ON HerediVar_ahdoebm1.list_variants TO 'HerediVar_read_only GRANT INSERT, UPDATE, DELETE ON HerediVar_ahdoebm1.user_variant_lists TO 'HerediVar_read_only'; GRANT SELECT ON HerediVar_ahdoebm1.gene_alias TO 'HerediVar_read_only'; GRANT SELECT ON HerediVar_ahdoebm1.variant_heredicare_annotation TO 'HerediVar_read_only'; -GRANT SELECT ON HerediVar_ahdoebm1.variant_transcript_annotation TO 'HerediVar_read_only'; \ No newline at end of file +GRANT SELECT ON HerediVar_ahdoebm1.variant_transcript_annotation TO 'HerediVar_read_only'; +GRANT INSERT,UPDATE ON HerediVar.heredivar_clinvar_submissions TO 'HerediVar_read_only'; \ No newline at end of file diff --git a/src/frontend_celery/webapp/templates/index.html b/src/frontend_celery/webapp/templates/index.html index 098d1fa3..704ab9eb 100644 --- a/src/frontend_celery/webapp/templates/index.html +++ b/src/frontend_celery/webapp/templates/index.html @@ -134,6 +134,7 @@

Changelog

  • Sometimes, the classification scheme was not changeable in consensus classifications
  • BRCA1 v1.0.0 PP1 criterium was missing strength selection and PP4 criterium was missing very strong strength
  • BRCA2 v1.0.0 PP1 and PP4 criteria were missing very strong strength
  • +
  • Fixed a bug when a standard or read only user was accessing the variant details page when a ClinVar submission was unfinished
  • Known issues: