Skip to content

Commit

Permalink
Add permission check for moving issue action in project view page (#2…
Browse files Browse the repository at this point in the history
…4589)

Fix #22954
Only users who have write permission can move issues in the project view page.
  • Loading branch information
yp05327 authored May 9, 2023
1 parent d5b2bf9 commit 2ee72d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/projects/view.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</div>
<div class="ui container fluid padded" id="project-board">

<div class="board">
<div class="board {{if .CanWriteProjects}}sortable{{end}}">
{{range $board := .Boards}}

<div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}">
Expand Down
5 changes: 4 additions & 1 deletion web_src/css/features/projects.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
margin: 0 0.5em;
}

.board.sortable .board-card {
cursor: move;
}

.board-column {
background-color: var(--color-project-board-bg) !important;
border: 1px solid var(--color-secondary) !important;
Expand Down Expand Up @@ -80,7 +84,6 @@
.board-card {
margin: 4px 2px !important;
border-radius: 5px !important;
cursor: move;
width: calc(100% - 4px) !important;
padding: 0.5rem !important;
min-height: auto !important;
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/repo-projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function moveIssue({item, from, to, oldIndex}) {
}

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

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

0 comments on commit 2ee72d0

Please sign in to comment.