mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #203 from sharelatex/sk-prevent-archived-deletion
Prevent user from trying to delete archived project they don't own
This commit is contained in:
commit
529d35936d
3 changed files with 8 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
input.select-item(
|
input.select-item(
|
||||||
select-individual,
|
select-individual,
|
||||||
type="checkbox",
|
type="checkbox",
|
||||||
|
ng-disabled="shouldDisableCheckbox(project)",
|
||||||
ng-model="project.selected"
|
ng-model="project.selected"
|
||||||
stop-propagation="click"
|
stop-propagation="click"
|
||||||
aria-label=translate('select_project') + " '{{ project.name }}'"
|
aria-label=translate('select_project') + " '{{ project.name }}'"
|
||||||
|
|
|
@ -49,18 +49,21 @@ define [
|
||||||
selectAllListController.clearSelectAllState()
|
selectAllListController.clearSelectAllState()
|
||||||
|
|
||||||
scope.$on "select-all:select", () ->
|
scope.$on "select-all:select", () ->
|
||||||
|
return if element.prop('disabled')
|
||||||
ignoreChanges = true
|
ignoreChanges = true
|
||||||
scope.$apply () ->
|
scope.$apply () ->
|
||||||
scope.ngModel = true
|
scope.ngModel = true
|
||||||
ignoreChanges = false
|
ignoreChanges = false
|
||||||
|
|
||||||
scope.$on "select-all:deselect", () ->
|
scope.$on "select-all:deselect", () ->
|
||||||
|
return if element.prop('disabled')
|
||||||
ignoreChanges = true
|
ignoreChanges = true
|
||||||
scope.$apply () ->
|
scope.$apply () ->
|
||||||
scope.ngModel = false
|
scope.ngModel = false
|
||||||
ignoreChanges = false
|
ignoreChanges = false
|
||||||
|
|
||||||
scope.$on "select-all:row-clicked", () ->
|
scope.$on "select-all:row-clicked", () ->
|
||||||
|
return if element.prop('disabled')
|
||||||
ignoreChanges = true
|
ignoreChanges = true
|
||||||
scope.$apply () ->
|
scope.$apply () ->
|
||||||
scope.ngModel = !scope.ngModel
|
scope.ngModel = !scope.ngModel
|
||||||
|
|
|
@ -462,6 +462,9 @@ define [
|
||||||
|
|
||||||
App.controller "ProjectListItemController", ($scope) ->
|
App.controller "ProjectListItemController", ($scope) ->
|
||||||
|
|
||||||
|
$scope.shouldDisableCheckbox = (project) ->
|
||||||
|
$scope.filter == 'archived' && project.accessLevel != 'owner'
|
||||||
|
|
||||||
$scope.projectLink = (project) ->
|
$scope.projectLink = (project) ->
|
||||||
if project.accessLevel == 'readAndWrite' and project.source == 'token'
|
if project.accessLevel == 'readAndWrite' and project.source == 'token'
|
||||||
"/#{project.tokens.readAndWrite}"
|
"/#{project.tokens.readAndWrite}"
|
||||||
|
|
Loading…
Reference in a new issue