mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Prevent user from trying to delete archived project they don't own
This change disables the select-project checkbox if the user is on the 'archived' project pane and they don't own the project. The request to delete would fail anyway, but this prevents UI confusion
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
input.select-item(
|
||||
select-individual,
|
||||
type="checkbox",
|
||||
ng-disabled="shouldDisableCheckbox(project)",
|
||||
ng-model="project.selected"
|
||||
stop-propagation="click"
|
||||
aria-label=translate('select_project') + " '{{ project.name }}'"
|
||||
|
||||
@@ -462,6 +462,9 @@ define [
|
||||
|
||||
App.controller "ProjectListItemController", ($scope) ->
|
||||
|
||||
$scope.shouldDisableCheckbox = (project) ->
|
||||
$scope.filter == 'archived' && project.accessLevel != 'owner'
|
||||
|
||||
$scope.projectLink = (project) ->
|
||||
if project.accessLevel == 'readAndWrite' and project.source == 'token'
|
||||
"/#{project.tokens.readAndWrite}"
|
||||
|
||||
Reference in New Issue
Block a user