mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -73,7 +73,7 @@
 | 
				
			|||||||
	</div>
 | 
						</div>
 | 
				
			||||||
	<div class="ui container fluid padded" id="project-board">
 | 
						<div class="ui container fluid padded" id="project-board">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		<div class="board">
 | 
							<div class="board {{if .CanWriteProjects}}sortable{{end}}">
 | 
				
			||||||
			{{range $board := .Boards}}
 | 
								{{range $board := .Boards}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}">
 | 
								<div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,10 @@
 | 
				
			|||||||
  margin: 0 0.5em;
 | 
					  margin: 0 0.5em;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.board.sortable .board-card {
 | 
				
			||||||
 | 
					  cursor: move;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.board-column {
 | 
					.board-column {
 | 
				
			||||||
  background-color: var(--color-project-board-bg) !important;
 | 
					  background-color: var(--color-project-board-bg) !important;
 | 
				
			||||||
  border: 1px solid var(--color-secondary) !important;
 | 
					  border: 1px solid var(--color-secondary) !important;
 | 
				
			||||||
@@ -80,7 +84,6 @@
 | 
				
			|||||||
.board-card {
 | 
					.board-card {
 | 
				
			||||||
  margin: 4px 2px !important;
 | 
					  margin: 4px 2px !important;
 | 
				
			||||||
  border-radius: 5px !important;
 | 
					  border-radius: 5px !important;
 | 
				
			||||||
  cursor: move;
 | 
					 | 
				
			||||||
  width: calc(100% - 4px) !important;
 | 
					  width: calc(100% - 4px) !important;
 | 
				
			||||||
  padding: 0.5rem !important;
 | 
					  padding: 0.5rem !important;
 | 
				
			||||||
  min-height: auto !important;
 | 
					  min-height: auto !important;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,7 +36,7 @@ function moveIssue({item, from, to, oldIndex}) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function initRepoProjectSortable() {
 | 
					async function initRepoProjectSortable() {
 | 
				
			||||||
  const els = document.querySelectorAll('#project-board > .board');
 | 
					  const els = document.querySelectorAll('#project-board > .board.sortable');
 | 
				
			||||||
  if (!els.length) return;
 | 
					  if (!els.length) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const {Sortable} = await import(/* webpackChunkName: "sortable" */'sortablejs');
 | 
					  const {Sortable} = await import(/* webpackChunkName: "sortable" */'sortablejs');
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user