Skip to content

Commit 2ee72d0

Browse files
authored
Add permission check for moving issue action in project view page (#24589)
Fix #22954 Only users who have write permission can move issues in the project view page.
1 parent d5b2bf9 commit 2ee72d0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

templates/projects/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div>
7474
<div class="ui container fluid padded" id="project-board">
7575

76-
<div class="board">
76+
<div class="board {{if .CanWriteProjects}}sortable{{end}}">
7777
{{range $board := .Boards}}
7878

7979
<div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}">

web_src/css/features/projects.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
margin: 0 0.5em;
77
}
88

9+
.board.sortable .board-card {
10+
cursor: move;
11+
}
12+
913
.board-column {
1014
background-color: var(--color-project-board-bg) !important;
1115
border: 1px solid var(--color-secondary) !important;
@@ -80,7 +84,6 @@
8084
.board-card {
8185
margin: 4px 2px !important;
8286
border-radius: 5px !important;
83-
cursor: move;
8487
width: calc(100% - 4px) !important;
8588
padding: 0.5rem !important;
8689
min-height: auto !important;

web_src/js/features/repo-projects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function moveIssue({item, from, to, oldIndex}) {
3636
}
3737

3838
async function initRepoProjectSortable() {
39-
const els = document.querySelectorAll('#project-board > .board');
39+
const els = document.querySelectorAll('#project-board > .board.sortable');
4040
if (!els.length) return;
4141

4242
const {Sortable} = await import(/* webpackChunkName: "sortable" */'sortablejs');

0 commit comments

Comments
 (0)