diff --git a/Gemfile b/Gemfile index bd596d75c..9e19475ea 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,6 @@ gem 'omniauth-rails_csrf_protection' gem 'postmark-rails' gem 'prophet-rb', '~> 0.5.3' gem 'puma' -gem 'pundit' gem 'rails', '8.0.1' gem 'rails-html-sanitizer' gem 'rack-cors', '~> 2.0' diff --git a/Gemfile.lock b/Gemfile.lock index e04a11fc9..170220776 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -362,8 +362,6 @@ GEM public_suffix (6.0.1) puma (6.5.0) nio4r (~> 2.0) - pundit (2.4.0) - activesupport (>= 3.0.0) raabro (1.4.0) racc (1.8.1) rack (3.1.8) @@ -591,7 +589,6 @@ DEPENDENCIES postmark-rails prophet-rb (~> 0.5.3) puma - pundit rack-cors (~> 2.0) rails (= 8.0.1) rails-controller-testing diff --git a/app/assets/javascripts/components/archive_case/_modal.html b/app/assets/javascripts/components/archive_case/_modal.html index 0457d65aa..a9b344a39 100644 --- a/app/assets/javascripts/components/archive_case/_modal.html +++ b/app/assets/javascripts/components/archive_case/_modal.html @@ -3,14 +3,9 @@ diff --git a/app/assets/javascripts/components/archive_case/archive_case_modal_instance_controller.js b/app/assets/javascripts/components/archive_case/archive_case_modal_instance_controller.js index 1ec9fddf6..629c1cef3 100644 --- a/app/assets/javascripts/components/archive_case/archive_case_modal_instance_controller.js +++ b/app/assets/javascripts/components/archive_case/archive_case_modal_instance_controller.js @@ -8,18 +8,7 @@ angular.module('QuepidApp') function ($rootScope, $uibModalInstance, theCase) { var ctrl = this; - ctrl.theCase = theCase; - ctrl.canDelete = false; - - $rootScope.$watch('currentUser', function() { - if ( $rootScope.currentUser ) { - ctrl.canDelete = $rootScope.currentUser.permissions.case.delete; - } - }); - - ctrl.isOwnerOfCase = function() { - return ($rootScope.currentUser.id === ctrl.theCase.ownerId); - }; + ctrl.theCase = theCase; ctrl.ok = function () { $uibModalInstance.close(true); diff --git a/app/assets/javascripts/components/archive_search_endpoint/_modal.html b/app/assets/javascripts/components/archive_search_endpoint/_modal.html index a0666b10e..e69de29bb 100644 --- a/app/assets/javascripts/components/archive_search_endpoint/_modal.html +++ b/app/assets/javascripts/components/archive_search_endpoint/_modal.html @@ -1,16 +0,0 @@ - - - diff --git a/app/assets/javascripts/components/archive_search_endpoint/archive_search_endpoint_modal_instance_controller.js b/app/assets/javascripts/components/archive_search_endpoint/archive_search_endpoint_modal_instance_controller.js index a4d17f4d3..5b77dd77f 100644 --- a/app/assets/javascripts/components/archive_search_endpoint/archive_search_endpoint_modal_instance_controller.js +++ b/app/assets/javascripts/components/archive_search_endpoint/archive_search_endpoint_modal_instance_controller.js @@ -9,18 +9,6 @@ angular.module('QuepidApp') var ctrl = this; ctrl.theSearchEndpoint = theSearchEndpoint; - //ctrl.canDelete = false; - ctrl.canDelete = true; // hard code that anyone can delete ;-( - - //$rootScope.$watch('currentUser', function() { - // if ( $rootScope.currentUser ) { - // ctrl.canDelete = $rootScope.currentUser.permissions.search_endpoint.delete; - // } - //}); - - ctrl.isOwnerOfSearchEndpoint = function() { - return ($rootScope.currentUser.id === ctrl.theSearchEndpoint.ownerId); - }; ctrl.ok = function () { $uibModalInstance.close(true); diff --git a/app/assets/javascripts/components/case_listing/case_listing_controller.js b/app/assets/javascripts/components/case_listing/case_listing_controller.js index 9e414949d..5e397ec78 100644 --- a/app/assets/javascripts/components/case_listing/case_listing_controller.js +++ b/app/assets/javascripts/components/case_listing/case_listing_controller.js @@ -7,14 +7,12 @@ angular.module('QuepidApp') '$rootScope', '$scope', '$location', - 'flash', 'caseTryNavSvc', 'caseSvc', function ( $rootScope, $scope, $location, - flash, caseTryNavSvc, caseSvc ) { @@ -25,7 +23,6 @@ angular.module('QuepidApp') ctrl.clickToEdit.oldVal = ctrl.thisCase.caseName.slice(0); ctrl.clickToEdit.currVal = ctrl.thisCase.caseName.slice(0); ctrl.clickToEdit.clicked = false; - ctrl.canUpdate = false; // Functions ctrl.cancel = cancel; @@ -39,19 +36,8 @@ angular.module('QuepidApp') $location.path(path); } - $rootScope.$watch('currentUser', function() { - if ( $rootScope.currentUser ) { - ctrl.canUpdate = $rootScope.currentUser.permissions.case.update; - } - }); - - function rename() { - if (ctrl.canUpdate) { - ctrl.clickToEdit.clicked = true; - } - else { - flash.error = 'You do not have update permissions for cases.'; - } + function rename() { + ctrl.clickToEdit.clicked = true; } function cancel() { diff --git a/app/assets/javascripts/components/clone_case/clone_case_controller.js b/app/assets/javascripts/components/clone_case/clone_case_controller.js index 032df3918..cc8a2fc55 100644 --- a/app/assets/javascripts/components/clone_case/clone_case_controller.js +++ b/app/assets/javascripts/components/clone_case/clone_case_controller.js @@ -37,39 +37,26 @@ angular.module('QuepidApp') }); } - function prompt() { - if ( !$rootScope.currentUser.permissions.case.create ) { - var deniedModalInstance = $uibModal.open({ - templateUrl: 'new_case/_denied_modal.html', - controller: 'DeniedNewCaseModalInstanceCtrl', - controllerAs: 'ctrl' - }); - - deniedModalInstance.result.then( - function() { }, - function() { } - ); - } else { - var modalInstance = $uibModal.open({ - templateUrl: 'clone_case/_modal.html', - controller: 'CloneCaseModalInstanceCtrl', - controllerAs: 'ctrl', - resolve: { - theCase: function() { - return ctrl.acase; - } + function prompt() { + var modalInstance = $uibModal.open({ + templateUrl: 'clone_case/_modal.html', + controller: 'CloneCaseModalInstanceCtrl', + controllerAs: 'ctrl', + resolve: { + theCase: function() { + return ctrl.acase; } - }); + } + }); - modalInstance.result.then( - function (options) { - ctrl.cloneCase(options); - }, - function() { - $log.info('INFO: Modal dismissed'); - } - ); - } + modalInstance.result.then( + function (options) { + ctrl.cloneCase(options); + }, + function() { + $log.info('INFO: Modal dismissed'); + } + ); } } ]); diff --git a/app/assets/javascripts/components/clone_scorer/clone_scorer_controller.js b/app/assets/javascripts/components/clone_scorer/clone_scorer_controller.js index 0b16c38c0..e7a3edb2b 100644 --- a/app/assets/javascripts/components/clone_scorer/clone_scorer_controller.js +++ b/app/assets/javascripts/components/clone_scorer/clone_scorer_controller.js @@ -21,14 +21,6 @@ angular.module('QuepidApp') var ctrl = this; ctrl.buttonText = $scope.buttonText; - ctrl.cannotCreate = true; - - $rootScope.$watch('currentUser', function() { - if ( $rootScope.currentUser ) { - ctrl.cannotCreate = !$rootScope.currentUser.permissions.team.create; - } - }); - // Functions ctrl.cloneScorer = cloneScorer; diff --git a/app/assets/javascripts/components/delete_case/_modal.html b/app/assets/javascripts/components/delete_case/_modal.html index e7ff76ead..7709ef28e 100644 --- a/app/assets/javascripts/components/delete_case/_modal.html +++ b/app/assets/javascripts/components/delete_case/_modal.html @@ -3,8 +3,7 @@ - -